summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-06-06 13:29:21 +0200
committerAlan Pearce2024-06-06 13:29:21 +0200
commitdc48f429240cbacdc5a3dff6b698fc297e2ab17c (patch)
treed529625ad83dc03854911f5ad2a1362dee038057
parente117d4f464b801ca7905285bc158a0dcdbf35841 (diff)
downloadnixfiles-dc48f429240cbacdc5a3dff6b698fc297e2ab17c.tar.lz
nixfiles-dc48f429240cbacdc5a3dff6b698fc297e2ab17c.tar.zst
nixfiles-dc48f429240cbacdc5a3dff6b698fc297e2ab17c.zip
include local sources in pinned nix path
-rw-r--r--shell.nix19
-rw-r--r--sources.nix15
-rw-r--r--system/settings/pin.nix14
3 files changed, 25 insertions, 23 deletions
diff --git a/shell.nix b/shell.nix
index d1270312..f41153fc 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,19 +1,7 @@
 let
-  sources = import ./npins;
+  inherit (import ./sources.nix) nixPath sources;
 
-  nixpkgs = sources.nixpkgs;
-  pkgs = import nixpkgs { };
-  inherit (pkgs) lib;
-  # lib = import ./lib { inherit pkgs; };
-  inherit (import ./lib { inherit pkgs; }) mkNixPath fromSources;
-
-  nixPath = builtins.concatStringsSep ":" (mkNixPath
-    ({
-      personal = ./packages;
-      nixpkgs-overlays = ./overlays;
-      private = ./private;
-    } // (fromSources sources))
-  );
+  pkgs = import sources.nixpkgs { };
 in
 pkgs.mkShell
 {
@@ -27,7 +15,6 @@ pkgs.mkShell
   ];
 
   shellHook = ''
-    export NIX_PATH="${nixPath}";
+    export NIX_PATH="${builtins.concatStringsSep ":"nixPath}";
   '';
-
 }
diff --git a/sources.nix b/sources.nix
new file mode 100644
index 00000000..8bcc5a4f
--- /dev/null
+++ b/sources.nix
@@ -0,0 +1,15 @@
+let
+  sources = import ./npins;
+  pkgs = import sources.nixpkgs { };
+  inherit (import ./lib { inherit pkgs; }) mkNixPath fromSources;
+
+  allSources = {
+    personal = ./packages;
+    nixpkgs-overlays = ./overlays;
+    private = ./private;
+  } // (fromSources sources);
+in
+{
+  sources = allSources;
+  nixPath = mkNixPath allSources;
+}
diff --git a/system/settings/pin.nix b/system/settings/pin.nix
index 381115bd..533149fe 100644
--- a/system/settings/pin.nix
+++ b/system/settings/pin.nix
@@ -1,12 +1,12 @@
-{ pkgs, ... }:
 let
-  lib = import ../../lib { inherit pkgs; };
-  sources = import ../../npins;
+  inherit (import ../../sources.nix) nixPath sources;
 in
 {
-  nix.nixPath = lib.mkNixPath sources;
-  nix.registry.nixpkgs.to = {
-    type = "path";
-    path = sources.nixpkgs;
+  nix = {
+    inherit nixPath;
+    registry.nixpkgs.to = {
+      type = "path";
+      path = sources.nixpkgs;
+    };
   };
 }