nixos-config/machine/not522/installer/default.nix
Charlotte 🦝 Delenk 8efe0d5149
All checks were successful
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #22463 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra nixosConfigurations.not522 Hydra build #22465 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.not522-installer Hydra build #22466 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #22464 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
Hydra checks.x86_64-linux.containers-default Hydra build #22461 of nixos-config:pr618:checks.x86_64-linux.containers-default
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #22462 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
add an installer for not522
2024-10-30 09:06:52 +01:00

40 lines
1.3 KiB
Nix

{
nixos-config,
nixos-hardware,
config,
pureInputs,
pkgs,
lib,
...
}: let
dependencies =
[
nixos-config.nixosConfigurations.not522.config.system.build.toplevel
nixos-config.nixosConfigurations.not522.config.system.build.diskoScript
nixos-config.nixosConfigurations.not522.config.system.build.diskoScript.drvPath
nixos-config.nixosConfigurations.not522.pkgs.stdenv.drvPath
(nixos-config.nixosConfigurations.not522.pkgs.closureInfo {rootPaths = [];}).drvPath
]
++ map (i: i.outPath) (builtins.filter builtins.isAttrs (builtins.attrValues pureInputs));
closureInfo = pkgs.closureInfo {rootPaths = dependencies;};
in {
networking.hostName = "not522-installer";
imports = [
"${nixos-config}/config"
"${nixos-config}/machine/not522/hardware.nix"
"${nixos-config}/machine/not522/cross-packages.nix"
./disko.nix
];
system.stateVersion = config.system.nixos.version;
environment.etc."install-closure".source = "${closureInfo}/store-paths";
environment.systemPackages = [
(pkgs.writeShellScriptBin "install-nixos-unattended" ''
set -eux
exec ${pkgs.disko}/bin/disko-install --flake "${nixos-config}#not522" --disk main "${nixos-config.nixosConfigurations.not522.config.disko.devices.disk.main.device}"
'')
];
}