summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-10-22 23:44:02 +0200
committerMel <einebeere@gmail.com>2024-10-22 23:44:02 +0200
commit656780d794dd2066b6bfd909e65b78df7afca84f (patch)
treeff9844f440b2e4d047119b0dcaf9aa444d8f7e69 /modules
parentbb0e4c7b5bbec7b8d8e3433a87683e9bb5ec307a (diff)
downloadminerals-656780d794dd2066b6bfd909e65b78df7afca84f.tar.zst
minerals-656780d794dd2066b6bfd909e65b78df7afca84f.zip
Change nix path to point to compatibility scripts
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/common.nix9
-rw-r--r--modules/nix.nix24
2 files changed, 25 insertions, 8 deletions
diff --git a/modules/common.nix b/modules/common.nix
index 360dd21..cfe84a6 100644
--- a/modules/common.nix
+++ b/modules/common.nix
@@ -2,6 +2,7 @@
 
 {
   imports = [
+    ./nix.nix
     ./user.nix
     ./locale.nix
     ./gnome.nix
@@ -13,14 +14,6 @@
 
   boot.kernelPackages = pkgs.linuxPackages_latest;
 
-  nix.settings = {
-    experimental-features = [ "flakes" "nix-command" ];
-  } // lib.optionalAttrs (me != "bismuth") {
-    # add the bismuth binary cache, if we're not bismuth;
-    substituters = [ "http://bismuth:5000" ];
-    trusted-public-keys = [ "bismuth-1:XW9nsNsccipbmdfchyb3YIIWNT058iSpHLwlj1xgB7A=" ];
-  };
-
   services.envfs.enable = true;
   virtualisation.libvirtd.enable = true;
 
diff --git a/modules/nix.nix b/modules/nix.nix
new file mode 100644
index 0000000..b41d81a
--- /dev/null
+++ b/modules/nix.nix
@@ -0,0 +1,24 @@
+{ me, lib, self, ... }:
+
+let
+  imNotBismuth = (me != "bismuth");
+
+  bismuthCacheSettings = { 
+    substituters = [ "http://bismuth:5000" ];
+    trusted-public-keys = [ "bismuth-1:XW9nsNsccipbmdfchyb3YIIWNT058iSpHLwlj1xgB7A=" ];
+  };
+
+in
+{
+  nix = {
+    # 
+    nixPath = [
+      "nixpkgs=${self}/compat"
+      "nixos-config=${self}/compat/nixos"
+    ];
+
+    settings = {
+      experimental-features = [ "flakes" "nix-command" ];
+    } // lib.optionalAttrs imNotBismuth bismuthCacheSettings; # use bismuth cache
+  };
+}