Description
Hi!
I love the idea of partitions and dev-only inputs! I've been using dev subflakes for a while now.
Most of my projects use the same dev tools (treefmt, git-pre-commit, deadnix, etc.), so I've developed a single flake that I reuse across repositories as a git submodule.
I tried to migrate my setup to partitions
, but it failed with
error: getting status of '/nix/store/q01xsd47sfigj2qapf5y9sqzvwj6z6dz-source/dev': No such file or directory
because git submodules aren't copied to the nix store by nix
commands by default, and there's no way to enable it within the flake.nix
.
The next thing I tried is to specify my dev flake as an input to the parent flake (yes, it kinda defeats the purpose, but with flake = false;
it's just one extra input instead of multiple). Now if I set the extraInputsFlake
to builtins.unsafeDiscardStringContext inputs.nix-dev-flake.outPath;
and try to use partitions it fails with:
error: cannot call 'getFlake' on unlocked flake reference '/nix/store/qcy8ish4gglcvhnyd8zm0my125z114bj-source', at «none»:0 (use --impure to override)
This seems to be a problem with Nix flakes' behavior. I am using Nix version 2.18.5, in case that’s relevant.
Is there a way around this? Is there a way to use partitions
with dev
files not being physically present in the same repository and without adding ?submodules=1
to every command in the case of git submodules or --impure
with flake input?
I realize that this is an extremely specific corner case and I am probably the only one experiencing it, but maybe I'm missing something.
Thanks!