all repos — nixfiles @ 802741a5292636b9a1619c712e128a77976e9d31

System and user configuration, managed by nix and home-manager

add local submodules to nix path

Alan Pearce
commit

802741a5292636b9a1619c712e128a77976e9d31

parent

15062a1bf490549f2c2a70938f6ff3a1bcbe2650

1 file changed, 12 insertions(+), 5 deletions(-)

changed files
M lib/default.nixlib/default.nix
@@ -7,12 +7,19 @@ rec {
importPathStore = p: "${append ../. "/${p}"}"; mkPathable = s: toString ( - if s.type == "local" - then (lib.path.append ../. s.outPath) - else s.outPath + if lib.path.subpath.isValid s + then (lib.path.append ../. s) + else s ); + kvPath = k: v: "${k}=${v}"; + + fromSources = sources: + lib.attrsets.mapAttrs + (k: v: v.outPath) + sources; + mkNixPath = sources: lib.attrsets.mapAttrsToList - (k: v: "${k}=${mkPathable v}") - (removeAttrs sources [ "__functor" ]); + (k: v: kvPath k (mkPathable v)) + sources; }