Johan Rong há 5 meses atrás
pai
commit
e38c0cc800
3 ficheiros alterados com 35 adições e 0 exclusões
  1. 1 0
      .gitignore
  2. 5 0
      README.md
  3. 29 0
      flake.nix

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+iso-output

+ 5 - 0
README.md

@@ -5,4 +5,9 @@
 ```bash
 nix flake show
 sudo nixos-rebuild switch --flake .#nixstation
+```
+
+## Build ISO
+```bash
+nix build ".#isos.nixstation"
 ```

+ 29 - 0
flake.nix

@@ -61,6 +61,25 @@
           ] ++ modules;
         };
 
+      mkISOConfiguration =
+        {
+          host,
+          nixpkgs,
+        }:
+        nixpkgs.lib.nixosSystem {
+          system = host.arch;
+          modules = [
+            nix-flatpak.nixosModules.nix-flatpak
+            "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix"
+            ./hosts/${host.dir}/configuration.nix
+            {
+              # ISO-specific configuration
+              isoImage.fileName = "${host.hostname}-installer.iso";
+              isoImage.volumeID = "${builtins.substring 0 11 host.hostname}";
+            }
+          ];
+        };
+
     in
     {
       nixosConfigurations."${hosts.nixstation.hostname}" = mkNixOSConfigurations {
@@ -74,6 +93,16 @@
         home-manager = inputs.home-manager;
       };
 
+      isos.nixstation = (mkISOConfiguration {
+        host = hosts.nixstation;
+        nixpkgs = inputs.nixpkgs;
+      }).config.system.build.isoImage;
+
+      isos.nixtop = (mkISOConfiguration {
+        host = hosts.nixtop;
+        nixpkgs = inputs.nixpkgs;
+      }).config.system.build.isoImage;
+
       #homeConfigurations."${hosts.workstation.user}@${hosts.workstation.hostname}" = mkHomeConfigurations {
       #  host = hosts.workstation;
       #  nixpkgs = inputs.nixpkgs;