summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-10-03 17:15:36 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-10-03 17:15:36 +0200
commit9248259708bd6ade5e334a2cdfb29d2a20acb0dd (patch)
tree976a140d547557c8cdf98856510030fd35b83d1a /flake.nix
parent59e54bd97f70711573d321f2d2aeee5da46bf95d (diff)
downloadnixos-9248259708bd6ade5e334a2cdfb29d2a20acb0dd.tar
nixos-9248259708bd6ade5e334a2cdfb29d2a20acb0dd.tar.gz
nixos-9248259708bd6ade5e334a2cdfb29d2a20acb0dd.tar.bz2
nixos-9248259708bd6ade5e334a2cdfb29d2a20acb0dd.tar.xz
nixos-9248259708bd6ade5e334a2cdfb29d2a20acb0dd.zip
...
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix21
1 files changed, 11 insertions, 10 deletions
diff --git a/flake.nix b/flake.nix
index defcd864..43825563 100644
--- a/flake.nix
+++ b/flake.nix
@@ -157,7 +157,10 @@
157 157
158 # systemsSelector = "x86_64-linux"; 158 # systemsSelector = "x86_64-linux";
159 # systems = filter (system: !(isNull (builtins.match systemsSelector system))) nixpkgs.lib.systems.flakeExposed; 159 # systems = filter (system: !(isNull (builtins.match systemsSelector system))) nixpkgs.lib.systems.flakeExposed;
160 systems = nixpkgs.lib.systems.flakeExposed; 160 systems =
161 let
162 disallowedSystems = ["armv5tel-linux"];
163 in filter (system: !(elem system disallowedSystems)) nixpkgs.lib.systems.flakeExposed;
161 nixpkgsPackages = localSystem: (makeOverridable (import (nixpkgs.outPath + "/pkgs/top-level"))) { inherit localSystem; }; 164 nixpkgsPackages = localSystem: (makeOverridable (import (nixpkgs.outPath + "/pkgs/top-level"))) { inherit localSystem; };
162 forAllSystems = f: mapAttrs f (genAttrs systems nixpkgsPackages); 165 forAllSystems = f: mapAttrs f (genAttrs systems nixpkgsPackages);
163 forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts))); 166 forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts)));
@@ -167,20 +170,18 @@
167 170
168 overlayPaths = nixImport rec { dir = ./overlays; _import = (path: _name: dir + "/${path}"); }; 171 overlayPaths = nixImport rec { dir = ./overlays; _import = (path: _name: dir + "/${path}"); };
169 172
170 installerProfiles = system: 173 installerProfiles = nixImport rec {
171 let nixpkgs-path = nixpkgs.outPath; 174 dir = ./installer-profiles;
172 in mapAttrs (name: {path, output}: { profile = mkSystemProfile nixpkgs-path path "installer-${name}"; inherit output; }) 175 _import = path: name: mkSystemProfile dir path "installer-${name}";
173 { cd-dvd = { path = "nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"; output = out: out.config.system.build.isoImage; }; 176 };
174 netboot = { path = "nixos/modules/installer/netboot/netboot-minimal.nix"; output = out: (self.legacyPackages.${system}.symlinkJoin { name = "netboot"; paths = with out.config.system.build; [ netbootRamdisk kernel netbootIpxeScript ]; preferLocalBuild = true; }); };
175 };
176 177
177 installerConfig = if pathExists ./installer.nix then "installer.nix" else (if pathExists ./installer then "installer" else null); 178 installerConfig = if pathExists ./installer.nix then "installer.nix" else (if pathExists ./installer then "installer" else null);
178 mkInstallerForSystem = system: (lib.systems.elaborate system).isLinux; 179 mkInstallerForSystem = system: (lib.systems.elaborate system).isLinux;
179 installers = 180 installers =
180 let mkInstallers = system: mapAttrs (mkInstaller system) (installerProfiles system); 181 let mkInstallers = system: mapAttrs (mkInstaller system) installerProfiles;
181 mkInstaller = system: name: {profile, output}: let mkOutput = output; in rec { config = mkNixosConfiguration [profile { config = { nixpkgs.system = system; }; }] ./. installerConfig "installer"; output = mkOutput config; }; 182 mkInstaller = system: name: profile: mkNixosConfiguration [profile { config = { nixpkgs.system = system; }; }] ./. installerConfig "installer";
182 in forAllSystems (system: _systemPkgs: optionalAttrs (!(isNull installerConfig) && mkInstallerForSystem system) (mkInstallers system)); 183 in forAllSystems (system: _systemPkgs: optionalAttrs (!(isNull installerConfig) && mkInstallerForSystem system) (mkInstallers system));
183 installerNixosConfigurations = listToAttrs (concatLists (mapAttrsToList (system: mapAttrsToList (profile: { config, ... }: nameValuePair ("installer-${system}-${profile}") config)) installers)); 184 installerNixosConfigurations = listToAttrs (concatLists (mapAttrsToList (system: mapAttrsToList (profile: config: nameValuePair ("installer-${system}-${profile}") config)) installers));
184 185
185 # packages = forAllSystems (system: systemPkgs: composeManyExtensions (attrValues self.overlays) self.legacyPackages.${system} systemPkgs); 186 # packages = forAllSystems (system: systemPkgs: composeManyExtensions (attrValues self.overlays) self.legacyPackages.${system} systemPkgs);
186 187