this post was submitted on 22 Aug 2023
7 points (100.0% liked)

Nix / NixOS

1765 readers
2 users here now

Main links

Videos

founded 1 year ago
MODERATORS
 

I've got a small haskell project and I am building it using a flake using cabal2nix based on a package.yaml file.

nix build works fine, but I have trouble with my nix develop shell. The shell is built using shellFor from haskellPackages.

Is it possible to construct a shell that contains all dependencies to build the package, but not the package itself? I tried returning the buildInputs from the packages function, but that didn't seem to have any effect. When I return my package from that function, all dependencies are available, however the package is also built - is that how it is supposed to be?

#nix #haskell

you are viewing a single comment's thread
view the rest of the comments
[–] jakalx@programming.dev 1 points 1 year ago

Thanks for clearing that up for me!

I have this snippet in my flake now:

packages = _: [ self.packages.${system}.default ];

And it seems to do exactly what I wanted.