Add custom installer iso

This commit is contained in:
SebastianStork 2026-02-25 22:23:25 +01:00
parent 7adc4cf660
commit d4e1577ee1
Signed by: SebastianStork
SSH key fingerprint: SHA256:iEM011ogNMG1q8+U500adGu/9rpPuZ2KnFtbdLeqTiI

61
flake-parts/iso.nix Normal file
View file

@ -0,0 +1,61 @@
{ inputs, self, ... }:
{
perSystem =
{ system, lib, ... }:
{
packages.iso =
(inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
inherit (self) allHosts;
};
modules = lib.singleton (
{
config,
inputs,
pkgs,
allHosts,
...
}:
{
nixpkgs.hostPlatform = system;
nix.settings.experimental-features = [ "pipe-operators" ];
networking = {
hostName = "installer";
wireless.enable = false;
networkmanager.enable = true;
};
console.keyMap = "de-latin1-nodeadkeys";
boot.supportedFilesystems = {
zfs = false;
bcachefs = true;
};
environment.systemPackages = [ inputs.disko.packages.${pkgs.stdenv.hostPlatform.system}.default ];
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
users.users.root.openssh.authorizedKeys.keyFiles =
allHosts
|> lib.attrValues
|> lib.filter (host: host.config.networking.hostName != config.networking.hostName)
|> lib.filter (host: host.config |> lib.hasAttr "home-manager")
|> lib.map (host: host.config.home-manager.users.seb.custom.programs.ssh)
|> lib.filter (ssh: ssh.enable)
|> lib.map (ssh: ssh.publicKeyFile);
}
);
}).config.system.build.images.iso-installer;
};
}