From da318b17aae7bc8b91f44c4721f2cf9dfb51c36a Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Sun, 8 Dec 2024 23:18:28 +0100 Subject: [PATCH] feat(machines/ap01/recovery): fix levitation dependencies We should use the right DHCPv4. Signed-off-by: Ryan Lahfa --- machines/liminix/ap01/recovery.nix | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/machines/liminix/ap01/recovery.nix b/machines/liminix/ap01/recovery.nix index 38271f3..bb8643e 100644 --- a/machines/liminix/ap01/recovery.nix +++ b/machines/liminix/ap01/recovery.nix @@ -6,6 +6,7 @@ }: let svc = config.system.service; + parentConfig = config; in { defaultProfile.packages = with pkgs; [ @@ -19,22 +20,27 @@ in "${modulesPath}/kernel" "${modulesPath}/outputs/tftpboot.nix" "${modulesPath}/outputs.nix" + ( + { config, ... }: + { + services = { + # In this situation, we fallback to the appro VLAN. + # TODO: add support for the admin VLAN. + # Simplest DHCPv4 we can find. + dhcpv4 = svc.network.dhcp.client.build { + interface = parentConfig.hardware.networkInterfaces.lan; + }; + inherit (parentConfig.services) sshd; + defaultroute4 = svc.network.route.build { + via = "$(output ${config.services.dhcpv4} router)"; + target = "default"; + dependencies = [ config.services.dhcpv4 ]; + }; + }; + } + ) ]; nixpkgs.buildPlatform = builtins.currentSystem; - services = { - # In this situation, we fallback to the appro VLAN. - # TODO: add support for the admin VLAN. - # 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 ${config.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.