diff options
Diffstat (limited to 'system-profiles/core')
-rw-r--r-- | system-profiles/core/default.nix | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/system-profiles/core/default.nix b/system-profiles/core/default.nix index fede386b..71d0619a 100644 --- a/system-profiles/core/default.nix +++ b/system-profiles/core/default.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { flake, flakeInputs, home-manager, path, hostName, config, lib, pkgs, customUtils, ... }: | 1 | { flake, flakeInputs, home-manager, path, hostName, config, options, lib, pkgs, customUtils, ... }: |
2 | 2 | ||
3 | with lib; | 3 | with lib; |
4 | 4 | ||
@@ -83,11 +83,22 @@ in { | |||
83 | ''; | 83 | ''; |
84 | }; | 84 | }; |
85 | 85 | ||
86 | nixpkgs.flakeInput = mkOption { | 86 | nixpkgs = { |
87 | type = types.enum (attrNames flakeInputs); | 87 | flakeInput = mkOption { |
88 | default = if flakeInputs ? "nixpkgs-${hostName}" then "nixpkgs-${hostName}" else "nixpkgs"; | 88 | type = types.enum (attrNames flakeInputs); |
89 | defaultText = literalExpression ''if flakeInputs ? "nixpkgs-''${hostName}" then "nixpkgs-''${hostName}" else "nixpkgs"''; | 89 | default = if flakeInputs ? "nixpkgs-${hostName}" then "nixpkgs-${hostName}" else "nixpkgs"; |
90 | internal = true; | 90 | defaultText = literalExpression ''if flakeInputs ? "nixpkgs-''${hostName}" then "nixpkgs-''${hostName}" else "nixpkgs"''; |
91 | internal = true; | ||
92 | }; | ||
93 | extraOverlays = mkOption { | ||
94 | default = []; | ||
95 | type = types.listOf (mkOptionType { | ||
96 | name = "nixpkgs-overlay"; | ||
97 | description = "nixpkgs overlay"; | ||
98 | check = lib.isFunction; | ||
99 | merge = lib.mergeOneOption; | ||
100 | }); | ||
101 | }; | ||
91 | }; | 102 | }; |
92 | }; | 103 | }; |
93 | 104 | ||
@@ -97,7 +108,7 @@ in { | |||
97 | system.configurationRevision = mkIf (flake ? rev) flake.rev; | 108 | system.configurationRevision = mkIf (flake ? rev) flake.rev; |
98 | 109 | ||
99 | nixpkgs.pkgs = import (flakeInputs.${config.nixpkgs.flakeInput}.outPath + "/pkgs/top-level") { | 110 | nixpkgs.pkgs = import (flakeInputs.${config.nixpkgs.flakeInput}.outPath + "/pkgs/top-level") { |
100 | overlays = attrValues flake.overlays; | 111 | overlays = attrValues flake.overlays ++ config.nixpkgs.extraOverlays; |
101 | config = config.nixpkgs.externalConfig; | 112 | config = config.nixpkgs.externalConfig; |
102 | localSystem = config.nixpkgs.system; | 113 | localSystem = config.nixpkgs.system; |
103 | }; | 114 | }; |
@@ -131,7 +142,7 @@ in { | |||
131 | }; | 142 | }; |
132 | 143 | ||
133 | systemd.tmpfiles.rules = [ | 144 | systemd.tmpfiles.rules = [ |
134 | "L+ /run/nixpkgs - - - - ${flakeInputs.nixpkgs.outPath}" | 145 | "L+ /run/nixpkgs - - - - ${flakeInputs.${config.nixpkgs.flakeInput}.outPath}" |
135 | "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" '' | 146 | "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" '' |
136 | with builtins; | 147 | with builtins; |
137 | 148 | ||
@@ -200,6 +211,7 @@ in { | |||
200 | ++ (optional (options ? system.etc) { | 211 | ++ (optional (options ? system.etc) { |
201 | boot.initrd.systemd.enable = lib.mkDefault true; | 212 | boot.initrd.systemd.enable = lib.mkDefault true; |
202 | system.etc.overlay.enable = lib.mkDefault true; | 213 | system.etc.overlay.enable = lib.mkDefault true; |
214 | system.etc.overlay.mutable = lib.mkDefault (!config.systemd.sysusers.enable); | ||
203 | systemd.sysusers.enable = lib.mkDefault true; | 215 | systemd.sysusers.enable = lib.mkDefault true; |
204 | 216 | ||
205 | # Random perl remnants | 217 | # Random perl remnants |
@@ -210,5 +222,11 @@ in { | |||
210 | boot.loader.grub.enable = lib.mkDefault false; | 222 | boot.loader.grub.enable = lib.mkDefault false; |
211 | environment.defaultPackages = lib.mkDefault [ ]; | 223 | environment.defaultPackages = lib.mkDefault [ ]; |
212 | documentation.info.enable = lib.mkDefault false; | 224 | documentation.info.enable = lib.mkDefault false; |
225 | }) | ||
226 | ++ (optional (options ? nixpkgs.flake) { | ||
227 | nixpkgs.flake = { | ||
228 | setNixPath = false; | ||
229 | setFlakeRegistry = false; | ||
230 | }; | ||
213 | })); | 231 | })); |
214 | } | 232 | } |