diff --git a/flake.nix b/flake.nix index 95e94bd..8e00fe4 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,9 @@ _: host: host.config.system.build.toplevel ) self.nixosConfigurations; - hydraJobs.isos.installer = self.nixosConfigurations.installer.config.system.build.isoImage; + hydraJobs.isos = { + installer-minimal = self.nixosConfigurations.installer-minimal.config.system.build.isoImage; + installer-graphical = self.nixosConfigurations.installer-graphical.config.system.build.isoImage; + }; }; } diff --git a/hosts/x86_64-linux/installer-graphical.nix b/hosts/x86_64-linux/installer-graphical.nix new file mode 100644 index 0000000..da73509 --- /dev/null +++ b/hosts/x86_64-linux/installer-graphical.nix @@ -0,0 +1,9 @@ +{ nixpkgs-flake, ... }: +{ + imports = [ + "${nixpkgs-flake}/nixos/modules/installer/cd-dvd/installation-cd-graphical-combined.nix" + ]; + custom.platform.installer.enable = true; + isoImage.squashfsCompression = "zstd"; + system.installer.channel.enable = false; +} diff --git a/hosts/x86_64-linux/installer-minimal.nix b/hosts/x86_64-linux/installer-minimal.nix new file mode 100644 index 0000000..8e55847 --- /dev/null +++ b/hosts/x86_64-linux/installer-minimal.nix @@ -0,0 +1,9 @@ +{ nixpkgs-flake, ... }: +{ + imports = [ + "${nixpkgs-flake}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + ]; + custom.platform.installer.enable = true; + isoImage.squashfsCompression = "zstd"; + system.installer.channel.enable = false; +} diff --git a/hosts/x86_64-linux/installer.nix b/hosts/x86_64-linux/installer.nix deleted file mode 100644 index 2184486..0000000 --- a/hosts/x86_64-linux/installer.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - nixpkgs-flake, - lib, - pkgs, - ... -}: -let - zfs = pkgs.zfsUnstable.override { - # this overrides saves 10MB - samba = pkgs.coreutils; - - python3 = pkgs.python3Minimal; - }; -in -{ - imports = [ - "${nixpkgs-flake}/nixos/modules/installer/cd-dvd/installation-cd-graphical-combined.nix" - ]; - - # This block modified from https://github.com/nix-community/nixos-images - boot.zfs.package = zfs; - environment.defaultPackages = lib.mkForce [ zfs ]; - boot.kernelModules = [ "zfs" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.zfs_unstable ]; - - custom.services.nixCacheClient.enable = true; - services.qemuGuest.enable = true; - system.installer.channel.enable = false; - isoImage.squashfsCompression = "zstd"; - networking.wireless.enable = false; -} diff --git a/modules/platform/installer.nix b/modules/platform/installer.nix new file mode 100644 index 0000000..a7957b7 --- /dev/null +++ b/modules/platform/installer.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.custom.platform.installer; +in +{ + options.custom.platform.installer.enable = lib.mkEnableOption "installer ISO configuration"; + + config = lib.mkIf cfg.enable { + boot.supportedFilesystems.zfs = lib.mkForce true; + users.defaultUserShell = lib.mkForce pkgs.bash; + custom.services.nixCacheClient.enable = true; + services.qemuGuest.enable = true; + networking.wireless.enable = false; + }; +}