Closed Pacman99 closed 1 year ago
For context, this PR was discussed here in
I think flake-parts should promote encapsulation, but you are free to define this addition in your own flake for your convenience. I.e.
{
perInput = system: flake: {
# Allow for input coercion to string, ex: "${inputs'.flake-parts}/shell.nix"
inherit (flake) outPath;
};
}
I'd be open to adding this little module as flake-parts.flakeModules.perSystemOutPath
. (perInputOutPath
is probably not as obvious to readers)
Another idea is to add a perInput
attribute like flake
, such that self'.flake == self
; perhaps in perSystem.nix
's config
.
I want to pass
self'
to my nixos modules and be able to do"${self'}/...
to refer to paths within the flake. I think it would be good for flake-parts to preserveoutPath
withinself'
and inputs ininputs'
, so that wayself'
andinputs'
are identical toself
andinputs
but with system picked out.