Hi,
How do I cache a devShell from within the flake.nix
itself? I’ve asked this but it seems more difficult than it looks at first glance.
If devShell
uses mkShell
, then there are two problems:
- the mkShell derivation refuses to be built:
error: --- Error ------------------------------------------------------------------------------------------------------- nix builder for '/nix/store/ydg6ban9vkp3f00g7rcrzd7wmzcjyhrb-nixcfg-devshell.drv' failed with exit code 1; last 4 log lines: nobuildPhase This derivation is not meant to be built, aborting
- if I try to use it with linkFarmFromDrvs it complains about
drv.name
being missing
If devShell
uses stdenv.mkDerivation
, then:
error: --- Error ------------------------------------------------------------------------------------------------------- nix
builder for '/nix/store/ljwqzcg51xl50zp93f8v15m0bnfar5qn-nixcfg-devshell.drv' failed with exit code 1; last 2 log lines:
unpacking sources
variable $src or $srcs should point to the source
I also looked at nix-direnv
, but it seems like it uses nix print-dev-env
with --profile
to capture the closure of the development environment. I don’t really know how to emulate this with Nix inside the flake.nix
.
Any suggestions? I’m hoping for something “nicer” than manually tracking the nativeBuildInputs/buildInputs to feed to devShell and my own expression later.