about summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/system/nixpkgs/config.nix28
-rw-r--r--modules/system/nixpkgs/default.nix27
2 files changed, 30 insertions, 25 deletions
diff --git a/modules/system/nixpkgs/config.nix b/modules/system/nixpkgs/config.nix
new file mode 100644
index 00000000..1a24444d
--- /dev/null
+++ b/modules/system/nixpkgs/config.nix
@@ -0,0 +1,28 @@
+{
+  cfg,
+  myPkgs,
+  lib,
+  ...
+}: let
+  myPkgsOverlay = self: super: myPkgs;
+in {
+  nixpkgs = {
+    hostPlatform = cfg.systemName;
+
+    overlays = [
+      myPkgsOverlay
+    ];
+
+    config = {
+      # TODO: this fails because of the root tempsize, which should be increased
+      # contentAddressedByDefault = true;
+
+      hostSystem = cfg.systemName;
+
+      allowUnfreePredicate = pkg:
+        builtins.elem (lib.getName pkg) [
+          "pypemicro" # required by pynitrokey
+        ];
+    };
+  };
+}
diff --git a/modules/system/nixpkgs/default.nix b/modules/system/nixpkgs/default.nix
index ca28c7bd..eda3ac89 100644
--- a/modules/system/nixpkgs/default.nix
+++ b/modules/system/nixpkgs/default.nix
@@ -1,13 +1,9 @@
 {
   lib,
   config,
-  myPkgs,
-  pkgs,
   ...
-}: let
+} @ args: let
   cfg = config.soispha.nixpkgs;
-
-  myPkgsOverlay = self: super: myPkgs;
 in {
   options.soispha.nixpkgs = {
     enable = lib.mkEnableOption "Nixpkgs config";
@@ -17,24 +13,5 @@ in {
       type = lib.types.str;
     };
   };
-  config = {
-    nixpkgs = lib.mkIf cfg.enable {
-      hostPlatform = cfg.systemName;
-      config = {
-        hostSystem = cfg.systemName;
-        overlays = [
-          myPkgsOverlay
-        ];
-        config = {
-          # TODO: this fails because of the root tempsize, which should be increased
-          # contentAddressedByDefault = true;
-
-          allowUnfreePredicate = pkg:
-            builtins.elem (lib.getName pkg) [
-              "pypemicro" # required by pynitrokey
-            ];
-        };
-      };
-    };
-  };
+  config = lib.mkIf cfg.enable (import ./config.nix (args // {inherit cfg;}));
 }