garnix-io / garn

garn is a build tool and environment manager that replaces justfiles/makefiles, docker, and the annoying parts of READMEs. The builders lingua franca.
https://garn.io
Apache License 2.0
231 stars 5 forks source link

dogfooding `garn` #348

Open sol opened 10 months ago

sol commented 10 months ago

When I

git clone https://github.com/garnix-io/garn
cd garn && cabal install garn

and then use that version of garn on the tutorial then that fails because deno is missing:

$ garn enter
garn: deno: createProcess: exec: invalid argument (Bad file descriptor)

My naive assumption is that I should use nix while hacking on garn and then install it the nix-way, so that everything is wired up correctly. Is that right?

So, I guess my next step would be to get familiar with nix Haskell development. However, even more fun would be if there were a garn.ts so that I could use garn to hack on garn itself (+ some rudimentary instructions on how to get started).

soenkehahn commented 10 months ago

My naive assumption is that I should use nix while hacking on garn and then install it the nix-way, so that everything is wired up correctly. Is that right?

Yes. The garn repo has a flake.nix file that defines a default devShell (you can enter it with e.g. nix develop -Lc $SHELL). That provides deno and a lot of other things. In there cabal run garn:garn should work. (Also, e.g. just test should work.)

And then you can use nix profile install $GARN_REPO to install a version of garn from disk into your nix profile (well, once we figure out #347). And that version of garn should find its own deno.

So, I guess my next step would be to get familiar with nix Haskell development.

There's a few things to learn. The above devShell provides cabal (and ghc) and they should find all haskell dependencies.

However, even more fun would be if there were a garn.ts so that I could use garn to hack on garn itself (+ some rudimentary instructions on how to get started).

Yes, that'd be great. I think there's currently a few things that we do in the flake.nix file that garn currently doesn't allow us to do easily if we switched. But overall it'd be great to "self-host" the garn project.