diff --git a/hosts/common/core/system.nix b/hosts/common/core/system.nix index c2be5b7..23fd536 100644 --- a/hosts/common/core/system.nix +++ b/hosts/common/core/system.nix @@ -3,6 +3,7 @@ lib, nodeName, nodePath, + options, ... }: { # IP address math library @@ -198,10 +199,12 @@ # current system due to yubikey availability. forceRekeyOnSystem = builtins.extraBuiltins.unsafeCurrentSystem; hostPubkey = let - pubkeyPath = nodePath + "/secrets/host.pub"; + pubkeyPath = + if nodePath == null + then null + else nodePath + "/secrets/host.pub"; in - lib.mkIf (lib.pathExists pubkeyPath || lib.trace "Missing pubkey for ${nodeName}: ${toString pubkeyPath} not found, using dummy replacement key for now." false) - pubkeyPath; + lib.mkIf (pubkeyPath != null && lib.pathExists pubkeyPath) pubkeyPath; }; boot = { diff --git a/hosts/ward/default.nix b/hosts/ward/default.nix index 0a35b4a..885eccc 100644 --- a/hosts/ward/default.nix +++ b/hosts/ward/default.nix @@ -39,4 +39,14 @@ test = defineVm 11; #hi = defineVm 12; }; + + microvm.vms.test.config = { + imports = [ + ../common/core + ../../users/root + ]; + + home-manager.users.root.home.minimal = true; + rekey.hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBXXjI6uB26xOF0DPy/QyLladoGIKfAtofyqPgIkCH/g"; + }; } diff --git a/hosts/ward/microvms/test/default.nix b/hosts/ward/microvms/test/default.nix deleted file mode 100644 index 4888501..0000000 --- a/hosts/ward/microvms/test/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - imports = [ - ../../../common/core - - ../../../../users/root - ]; - - home-manager.users.root.home.minimal = true; -} diff --git a/hosts/ward/microvms/test/secrets/host.pub b/hosts/ward/microvms/test/secrets/host.pub deleted file mode 100644 index e8bb16b..0000000 --- a/hosts/ward/microvms/test/secrets/host.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBXXjI6uB26xOF0DPy/QyLladoGIKfAtofyqPgIkCH/g