diff options
author | Alan Pearce | 2025-03-02 15:18:43 +0100 |
---|---|---|
committer | Alan Pearce | 2025-03-02 23:56:41 +0100 |
commit | b5bcdf72cbc998550bf55af1842fe65f8c9ef0bf (patch) | |
tree | 06d7f026a1d6a026aeb548cf7a920a437270d995 /lib | |
parent | 734a3cebed8dd4be66a546179dbda890abc5a10d (diff) | |
download | nixfiles-b5bcdf72cbc998550bf55af1842fe65f8c9ef0bf.tar.lz nixfiles-b5bcdf72cbc998550bf55af1842fe65f8c9ef0bf.tar.zst nixfiles-b5bcdf72cbc998550bf55af1842fe65f8c9ef0bf.zip |
Revert "Switch back to flakes"
This reverts commit c0384c43821474d28af1d9696ceb473a0d769292.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 00000000..2cbaf55c --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,25 @@ +{ pkgs }: +with builtins; +let + inherit (pkgs) lib; +in +rec { + importPathStore = p: "${append ../. "/${p}"}"; + + mkPathable = s: toString ( + 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: kvPath k (mkPathable v)) + sources; +} |