devenv icon indicating copy to clipboard operation
devenv copied to clipboard

feature/treefmt - integrate treefmt-nix

Open jmuchovej opened this issue 11 months ago • 5 comments

attempting to continue the work from #1317.

jmuchovej avatar Jan 21 '25 00:01 jmuchovej

👋 @domenkozar thanks for already taking a peek! 😮 so, i've been trying to emulate the integration of git-hooks and it's been failing. (lol. perhaps due to my noviceness with Nix.)

essentially, in integrations/git-hooks.nix, you access git-hooks via inputs. when i attempt to mimic this behavior, i'm consistently getting an error stating that inputs.treefmt-nix doesn't exist. https://github.com/cachix/devenv/blob/68a6d54dbeb5622b8435d7f1acf9ce239a075635/src/modules/integrations/git-hooks.nix#L4-L7

jmuchovej avatar Jan 24 '25 16:01 jmuchovej

Just so you know, the way this integration needs to be done has changed based on the treefmt package.

I got it working in my own library here: https://github.com/use-the-fork/snow-blower/blob/main/modules/integrations/treefmt/default.nix

I hope that helps you guys!

UseTheFork avatar Feb 04 '25 23:02 UseTheFork

Is there anything I can do to help get this merged?

yurrriq avatar Feb 19 '25 17:02 yurrriq

Is there anything I can do to help get this merged?

main thing i haven't had time to dig into is getting treefmt injected into the actual integration. essentially, inputs.treefmt-nix is "not found".

it's possible that this implementation could be applied to devenv, but ☝️ (haven't had the time to dig into it).

https://github.com/jmuchovej/forked-devenv/blob/d433fb/src/modules/integrations/treefmt.nix#L5

@yurrriq happy to add you as a contributor so you can make edits directly. i can also push the small changes i've made (resolving the comments earlier and bringing up-to-date with main).

jmuchovej avatar Feb 21 '25 13:02 jmuchovej

@jmuchovej sure, I could play around next week

yurrriq avatar Feb 21 '25 23:02 yurrriq

Anyone willing to pick this one up?

domenkozar avatar Aug 04 '25 18:08 domenkozar

sure! i'd love to help contribute if i can. this would be a great feature to have :grin:

muni-corn avatar Sep 02 '25 06:09 muni-corn

I implemented treefmt integration handling the optional input, @jmuchovej , here: #2238 .

tarc avatar Oct 23 '25 02:10 tarc

Added in https://github.com/cachix/devenv/pull/2238

domenkozar avatar Oct 25 '25 21:10 domenkozar