summaryrefslogtreecommitdiff
path: root/system-profiles/core
diff options
context:
space:
mode:
Diffstat (limited to 'system-profiles/core')
-rw-r--r--system-profiles/core/default.nix43
1 files changed, 13 insertions, 30 deletions
diff --git a/system-profiles/core/default.nix b/system-profiles/core/default.nix
index 71d0619a..e5f9dc16 100644
--- a/system-profiles/core/default.nix
+++ b/system-profiles/core/default.nix
@@ -127,36 +127,16 @@ in {
127 127
128 flake-registry = "${flakeInputs.flake-registry}/flake-registry.json"; 128 flake-registry = "${flakeInputs.flake-registry}/flake-registry.json";
129 }; 129 };
130 nixPath = [ 130 nixPath = map (flake: "${flake}=flake:${flake}") (attrNames config.nix.registry);
131 "nixpkgs=${pkgs.runCommand "nixpkgs" {} ''
132 mkdir $out
133 ln -s ${./nixpkgs.nix} $out/default.nix
134 ln -s /run/nixpkgs/lib $out/lib
135 ''}"
136 ];
137 registry = 131 registry =
138 let override = { self = "nixos"; }; 132 let override = { self = "nixos"; };
139 in mapAttrs' (inpName: inpFlake: nameValuePair 133 in mapAttrs' (inpName: inpFlake: nameValuePair
140 (override.${inpName} or inpName) 134 (override.${inpName} or inpName)
141 { flake = inpFlake; } ) flakeInputs; 135 { to = { type = "path"; path = inpFlake; }; } ) flakeInputs;
142 }; 136 };
143 137
144 systemd.tmpfiles.rules = [ 138 systemd.tmpfiles.rules = [
145 "L+ /run/nixpkgs - - - - ${flakeInputs.${config.nixpkgs.flakeInput}.outPath}" 139 "L+ /run/nixpkgs - - - - ${flakeInputs.${config.nixpkgs.flakeInput}.outPath}"
146 "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" ''
147 with builtins;
148
149 attrValues (import
150 (
151 let lock = fromJSON (readFile ${flake + "/flake.lock"}); in
152 fetchTarball {
153 url = "https://github.com/edolstra/flake-compat/archive/''${lock.nodes.flake-compat.locked.rev}.tar.gz";
154 sha256 = lock.nodes.flake-compat.locked.narHash;
155 }
156 )
157 { src = ${flake}; }
158 ).defaultNix.overlays
159 ''}"
160 "L+ /etc/nixos - - - - ${flake}" 140 "L+ /etc/nixos - - - - ${flake}"
161 ] ++ map (input: "L+ /run/flake-inputs/${input} - - - - ${flakeInputs.${input}.outPath}") (attrNames flakeInputs); 141 ] ++ map (input: "L+ /run/flake-inputs/${input} - - - - ${flakeInputs.${input}.outPath}") (attrNames flakeInputs);
162 142
@@ -177,11 +157,9 @@ in {
177 { 157 {
178 manual.manpages.enable = true; 158 manual.manpages.enable = true;
179 systemd.user.startServices = "sd-switch"; 159 systemd.user.startServices = "sd-switch";
180
181 programs.ssh.internallyManaged = mkForce true;
182 } 160 }
183 ]; 161 ];
184 extraSpecialArgs = { inherit flake flakeInputs path; }; 162 extraSpecialArgs = { inherit flake flakeInputs path; hostConfig = config; };
185 }; 163 };
186 164
187 sops = mkIf hasSops { 165 sops = mkIf hasSops {
@@ -202,17 +180,22 @@ in {
202 }; 180 };
203 environment.systemPackages = with pkgs; [ git-annex scutiger ]; 181 environment.systemPackages = with pkgs; [ git-annex scutiger ];
204 } 182 }
205 ] ++ (optional (options ? system.switch.enableNg) { 183 ] ++ (optional (options ? system.rebuild.enableNg) {
206 system.switch = lib.mkDefault { 184 system.rebuild.enableNg = lib.mkDefault true;
207 enable = false; 185 })
208 enableNg = true; 186 ++ (optional (options ? services.userborn) {
187 services.userborn = {
188 enable = lib.mkDefault true;
189 passwordFilesLocation = lib.mkDefault "/var/lib/nixos";
209 }; 190 };
210 }) 191 })
192 ++ (optional (!(options ? services.userborn) && (options ? system.etc)) {
193 systemd.sysusers.enable = lib.mkDefault true;
194 })
211 ++ (optional (options ? system.etc) { 195 ++ (optional (options ? system.etc) {
212 boot.initrd.systemd.enable = lib.mkDefault true; 196 boot.initrd.systemd.enable = lib.mkDefault true;
213 system.etc.overlay.enable = lib.mkDefault true; 197 system.etc.overlay.enable = lib.mkDefault true;
214 system.etc.overlay.mutable = lib.mkDefault (!config.systemd.sysusers.enable); 198 system.etc.overlay.mutable = lib.mkDefault (!config.systemd.sysusers.enable);
215 systemd.sysusers.enable = lib.mkDefault true;
216 199
217 # Random perl remnants 200 # Random perl remnants
218 system.disableInstallerTools = lib.mkDefault true; 201 system.disableInstallerTools = lib.mkDefault true;