summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAlan Pearce2024-05-04 09:27:40 +0200
committerAlan Pearce2024-05-18 12:17:12 +0200
commit782e0000196146183ee4a7e91e60424c24652d2f (patch)
treeb21a2690ed3ecbd7085f653d1ba53a1236708a58 /lib
parent72e7e31cefd86fba84924c9b579020a4b733426c (diff)
downloadnixfiles-782e0000196146183ee4a7e91e60424c24652d2f.tar.lz
nixfiles-782e0000196146183ee4a7e91e60424c24652d2f.tar.zst
nixfiles-782e0000196146183ee4a7e91e60424c24652d2f.zip
nix: set nix.nixPath
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
new file mode 100644
index 00000000..93f64059
--- /dev/null
+++ b/lib/default.nix
@@ -0,0 +1,21 @@
+{ pkgs }:
+with builtins;
+let
+  inherit (pkgs) lib;
+in
+rec {
+  importPathStore = p: "${append ../. "/${p}"}";
+
+  mkPathable = s:
+    if
+      s.type == "local"
+    then
+      lib.path.append ../. s.outPath
+    else
+      toString s.outPath
+  ;
+
+  mkNixPath = sources: lib.attrsets.mapAttrsToList
+    (k: v: "${k}=${mkPathable v}")
+    (removeAttrs sources [ "__functor" ]);
+}