From 43b582fb33044966980fd7215b35aed9a5b786e5 Mon Sep 17 00:00:00 2001 From: Richie Cahill Date: Sat, 15 Feb 2025 19:23:30 -0500 Subject: [PATCH] creating a custom installer iso --- .gitignore | 3 +++ flake.nix | 6 ++++++ systems/installer/default.nix | 22 ++++++++++++++++++++++ users/richie/home/cli/zsh.nix | 2 +- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 systems/installer/default.nix diff --git a/.gitignore b/.gitignore index 24128cd..7679f11 100644 --- a/.gitignore +++ b/.gitignore @@ -165,3 +165,6 @@ test.* # syncthing .stfolder + +# nixos build results +result diff --git a/flake.nix b/flake.nix index afbf2ff..e26eb5b 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,12 @@ ]; specialArgs = { inherit inputs outputs; }; }; + installer = lib.nixosSystem { + modules = [ + ./systems/installer + ]; + specialArgs = { inherit inputs outputs; }; + }; }; }; } diff --git a/systems/installer/default.nix b/systems/installer/default.nix new file mode 100644 index 0000000..05bec6f --- /dev/null +++ b/systems/installer/default.nix @@ -0,0 +1,22 @@ +{ + inputs, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ]; + + environment.systemPackages = [ + inputs.system_tools.packages.x86_64-linux.default + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ]; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZFsc9CSH03ZUP7y81AHwSyjLwFmcshVFCyxDcYhBT rhapsody-in-green" # cspell:disable-line + ]; +} diff --git a/users/richie/home/cli/zsh.nix b/users/richie/home/cli/zsh.nix index 4b6a5e9..84088f5 100644 --- a/users/richie/home/cli/zsh.nix +++ b/users/richie/home/cli/zsh.nix @@ -25,7 +25,7 @@ "rspace" = "'for f in *\ *; do mv \"$f\" \"\${f// /_}\"; done'"; "rebuild" = "sudo nixos-rebuild switch --flake /home/richie/dotfiles#$HOST"; - "nix-test" = "nixos-rebuild test --flake /home/richie/dotfiles"; + "build_iso" = "nix build .#nixosConfigurations.installer.config.system.build.isoImage"; }; }; }