forked from mirrors_public/oddlama_nix-config
feat: allow specifying host pubkey as string
This commit is contained in:
parent
cbcd3c943b
commit
a0d22b8be1
4 changed files with 16 additions and 13 deletions
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
../../../common/core
|
||||
|
||||
../../../../users/root
|
||||
];
|
||||
|
||||
home-manager.users.root.home.minimal = true;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBXXjI6uB26xOF0DPy/QyLladoGIKfAtofyqPgIkCH/g
|
Loading…
Add table
Add a link
Reference in a new issue