From d29deeae56ad2a98d73490d3c2e0bcb5e6a71d11 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Sun, 8 Sep 2024 00:48:01 +0200 Subject: [PATCH] feat(ap01): use levitation for mass rebuilds To deal with mass rebuild disk space requirements, we can just levitate. In the future, we will use levitation as a general-purpose mechanism for partition layout migration, etc. Signed-off-by: Ryan Lahfa --- machines/ap01/_configuration.nix | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/machines/ap01/_configuration.nix b/machines/ap01/_configuration.nix index 380b16d..e1e6d2b 100644 --- a/machines/ap01/_configuration.nix +++ b/machines/ap01/_configuration.nix @@ -224,6 +224,36 @@ rec { defaultProfile.packages = with pkgs; [ zyxel-bootconfig min-collect-garbage - mtdutils + iwinfo + ifwait + # Levitate enable us to mass-reinstall the system on the fly. + (levitate.override { + config = { + imports = [ + "${modulesPath}/network" + "${modulesPath}/ssh" + "${modulesPath}/hardware.nix" + "${modulesPath}/kernel" + "${modulesPath}/outputs/tftpboot.nix" + "${modulesPath}/outputs.nix" + ]; + services = { + # Simplest DHCPv4 we can find. + dhcpv4 = svc.network.dhcp.client.build { + interface = config.hardware.networkInterfaces.lan; + }; + inherit (config.services) sshd; + defaultroute4 = svc.network.route.build { + via = "$(output ${services.dhcpv4} router)"; + target = "default"; + dependencies = [ config.services.dhcpv4 ]; + }; + }; + + defaultProfile.packages = [ mtdutils ]; + # Only keep root, which should inherit from DGN access control's root permissions. + users.root = config.users.root; + }; + }) ]; }