add basic install ISO generation
4 files changed, 162 insertions(+), 1 deletion(-)
M flake.lock → flake.lock
@@ -437,6 +437,100 @@ "type": "git", "url": "https://git.alin.ovh/mycal" } }, + "nix-rosetta-builder": { + "inputs": { + "nixos-generators": "nixos-generators", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745249216, + "narHash": "sha256-bNuaIdGrs8LfintWymo9KQTILwVxsw5T6zdfxZY6K0g=", + "owner": "cpick", + "repo": "nix-rosetta-builder", + "rev": "5cf6aa1f3f2fbb70443d33b5ef7779b7c7063392", + "type": "github" + }, + "original": { + "owner": "cpick", + "repo": "nix-rosetta-builder", + "type": "github" + } + }, + "nixlib": { + "locked": { + "lastModified": 1736643958, + "narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixlib_2": { + "locked": { + "lastModified": 1736643958, + "narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nix-rosetta-builder", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737057290, + "narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, + "nixos-generators_2": { + "inputs": { + "nixlib": "nixlib_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751903740, + "narHash": "sha256-PeSkNMvkpEvts+9DjFiop1iT2JuBpyknmBUs0Un0a4I=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "032decf9db65efed428afd2fa39d80f7089085eb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1755330281,@@ -712,6 +806,8 @@ "elgit": "elgit", "golink": "golink", "home-manager": "home-manager", "mycal": "mycal", + "nix-rosetta-builder": "nix-rosetta-builder", + "nixos-generators": "nixos-generators_2", "nixos-hardware": "nixos-hardware", "nixpkgs": [ "srvos",
M flake.nix → flake.nix
@@ -16,7 +16,14 @@ home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-rosetta-builder = { + url = "github:cpick/nix-rosetta-builder"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nur = { url = "github:nix-community/nur"; inputs.nixpkgs.follows = "nixpkgs";@@ -137,6 +144,7 @@ nixpkgs.overlays = [ angrr.overlays.default ]; } + nix-rosetta-builder.darwinModules.default srvos.darwinModules.desktop angrr.darwinModules.angrr ./system/hosts/marvin.nix@@ -189,5 +197,13 @@ ]; }; } ); + + packages = forAllSystems (system: { + minimal-iso = nixos-generators.nixosGenerate { + inherit system; + format = "iso"; + modules = [ ./system/hosts/installer.nix ]; + }; + }); }; }
A system/hosts/installer.nix
@@ -0,0 +1,33 @@ +{ + pkgs, + modulesPath, + ... +}: +{ + imports = [ + "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" + + ../settings/programs/base.nix + ../settings/hardware/nvidia-gpu.nix + ../settings/hardware/keyboard.nix + ../settings/hardware/keyboard-lofree.nix + ]; + + services.picom.enable = false; + + programs.neovim = { + enable = true; + defaultEditor = true; + }; + + environment.systemPackages = with pkgs; [ + ghq + git + ]; + + programs.fish = { + enable = true; + }; + users.users.nixos.shell = pkgs.fish; + users.users.root.shell = pkgs.fish; +}
M system/hosts/marvin.nix → system/hosts/marvin.nix
@@ -1,4 +1,5 @@ { + config, pkgs, lib, ...@@ -72,4 +73,19 @@ } ]; }; + nix.linux-builder = { + enable = !config.nix-rosetta-builder.enable; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + speedFactor = 8; + }; + + nix-rosetta-builder = { + enable = true; # turn off to bootstrap + memory = "32GiB"; + onDemand = true; + onDemandLingerMinutes = 180; + }; }