From 0a460f33740a5be6c1bfcff60d9cf8659d1c8034 Mon Sep 17 00:00:00 2001 From: niten Date: Mon, 18 Oct 2021 09:07:49 -0700 Subject: [PATCH] Attempted to fix initrd-network --- config/hosts/limina.nix | 1 + config/hosts/socrates.nix | 1 + config/hosts/spark.nix | 1 + lib/fudo/initrd-network.nix | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/hosts/limina.nix b/config/hosts/limina.nix index 84e8c60..d768ed6 100644 --- a/config/hosts/limina.nix +++ b/config/hosts/limina.nix @@ -23,6 +23,7 @@ }; initrd-network = { ip = "10.0.5.1"; + interface = "enp2s0"; keypair = { public-key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDIcnHmIo08UgpNwBLe0RKYipxtznWlxLlKNgzBP/lot"; private-key-file = "/state/ssh/initrd/ssh_ed25519_key"; diff --git a/config/hosts/socrates.nix b/config/hosts/socrates.nix index 49374f0..ba412c6 100644 --- a/config/hosts/socrates.nix +++ b/config/hosts/socrates.nix @@ -23,6 +23,7 @@ }; initrd-network = { ip = "10.0.5.10"; + interface = "enp1s0"; keypair = { public-key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMLsxECiR4kqvUutMFkOTkIC8nsKK++aQ7HYiWjLdKdb"; private-key-file = "/state/ssh/initrd/ssh_ed25519_key"; diff --git a/config/hosts/spark.nix b/config/hosts/spark.nix index 1cdda18..9070213 100644 --- a/config/hosts/spark.nix +++ b/config/hosts/spark.nix @@ -24,6 +24,7 @@ }; initrd-network = { ip = "10.0.5.108"; + interface = "enp3s0"; keypair = { public-key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIABpau0W1FAOnwHysFm/9uQ0XqMrB2GoCIfin5uLBEs8"; private-key-file = "/state/ssh/initrd/ssh_ed25519_key"; diff --git a/lib/fudo/initrd-network.nix b/lib/fudo/initrd-network.nix index c2e6e0c..a3c8c35 100644 --- a/lib/fudo/initrd-network.nix +++ b/lib/fudo/initrd-network.nix @@ -32,10 +32,10 @@ in { config = { boot = mkIf (initrd-cfg != null) { kernelParams = let - site = config.instance.local-site; + site = config.fudo.sites.${config.instance.local-site}; site-gateway = site.gateway-v4; netmask = - nixpkgs.lib.fudo.ip.maskFromV32Network site.network; + pkgs.lib.fudo.ip.maskFromV32Network site.network; in [ "ip=${initrd-cfg.ip}:${site-gateway}:${netmask}:${hostname}:${initrd-cfg.interface}" ];