Johan Rong 3 mesiacov pred
rodič
commit
1c7debe439

+ 7 - 2
README.md

@@ -6,11 +6,16 @@
 nix flake show
 ```
 ```bash
-sudo nixos-rebuild switch --flake .#configuration
+sudo nixos-rebuild switch --flake .#<hostname>
 ```
 or with `nh`
 ```bash
-nh os switch .#configuration
+nh os switch .#<hostname>
+```
+
+## Building installer ISOs
+```bash
+nix build .#nixosConfigurations.<hostname>-iso.config.system.build.isoImage
 ```
 
 ## Screenshots

+ 6 - 6
flake.lock

@@ -7,11 +7,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1779726825,
-        "narHash": "sha256-RUkMrREjKDQrA+dA9+xZviGAxM5W1aVdyOr/bSYpHrE=",
+        "lastModified": 1780361225,
+        "narHash": "sha256-wnV9ttf4fPWNonBIQmvlrSlNpQYgx5HgWWd007mwIFA=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "b179bde238977f7d4454fc770b1a727eaf55111c",
+        "rev": "e28654b71096e08c019d4861ca26acb646f583d8",
         "type": "github"
       },
       "original": {
@@ -39,11 +39,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1779971959,
-        "narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=",
+        "lastModified": 1780203844,
+        "narHash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "ec942ba042dad5ef097e2ef3a3effc034241f011",
+        "rev": "b51242d7d43689db2f3be91bd05d5b24fbb469c4",
         "type": "github"
       },
       "original": {

+ 21 - 0
flake.nix

@@ -60,6 +60,18 @@
             }
           ] ++ modules;
         };
+      mkISOConfiguration = # Build with: nix build .#nixosConfigurations.<hostname>-iso.config.system.build.isoImage
+        {
+          host,
+          nixpkgs,
+        }:
+        nixpkgs.lib.nixosSystem {
+          system = host.arch;
+          modules = [
+            ./hosts/${host.dir}/iso.nix
+            { networking.hostName = "${host.hostname}-iso"; }
+          ];
+        };
 
     in
     {
@@ -74,6 +86,15 @@
         home-manager = inputs.home-manager;
       };
 
+      nixosConfigurations."${hosts.nixstation.hostname}-iso" = mkISOConfiguration {
+        host = hosts.nixstation;
+        nixpkgs = inputs.nixpkgs;
+      };
+      nixosConfigurations."${hosts.dellaptop.hostname}-iso" = mkISOConfiguration {
+        host = hosts.dellaptop;
+        nixpkgs = inputs.nixpkgs;
+      };
+
       homeConfigurations."${hosts.nixstation.user}@${hosts.nixstation.hostname}" = mkHomeConfigurations {
         host = hosts.nixstation;
         nixpkgs = inputs.nixpkgs;

+ 6 - 0
hosts/dellaptop/iso.nix

@@ -0,0 +1,6 @@
+{ ... }:
+{
+  imports = [
+    ../../nixos/features/system/iso-base.nix
+  ];
+}

+ 7 - 0
hosts/nixstation/iso.nix

@@ -0,0 +1,7 @@
+{ ... }:
+{
+  imports = [
+    ../../nixos/features/system/iso-base.nix
+    ../../nixos/hardware/networking/bcm4360.nix
+  ];
+}

+ 25 - 0
nixos/features/system/iso-base.nix

@@ -0,0 +1,25 @@
+{ config, pkgs, modulesPath, ... }:
+{
+  imports = [
+    (modulesPath + "/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix")
+  ];
+
+  boot.kernelPackages = pkgs.linuxPackages_latest;
+
+  environment.systemPackages = with pkgs; [
+    nh
+    git
+    nano
+    wget
+    gparted
+    gptfdisk
+  ];
+
+  services.openssh = {
+    enable = true;
+    settings.PermitRootLogin = "yes";
+  };
+
+  nixpkgs.config.allowUnfree = true;
+  nix.settings.experimental-features = [ "nix-command" "flakes" ];
+}