Refactor SSH keys to use shared configuration

Move hardcoded SSH keys to shared/ssh-keys.nix and import in tahani configuration.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Christoph Schmatzler
2025-08-11 12:06:19 +02:00
parent 507d6d5aff
commit 06ce4cd768
2 changed files with 9 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
user, user,
... ...
}: let }: let
keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOk8iAnIaa1deoc7jw8YACPNVka1ZFJxhnU4G74TmS+p"]; sshKeys = import ../../../shared/ssh-keys.nix;
in { in {
imports = [ imports = [
../../../profiles/base ../../../profiles/base
@@ -92,11 +92,11 @@ in {
extraGroups = [ extraGroups = [
"docker" "docker"
]; ];
openssh.authorizedKeys.keys = keys; openssh.authorizedKeys.keys = sshKeys.keys;
}; };
root = { root = {
openssh.authorizedKeys.keys = keys; openssh.authorizedKeys.keys = sshKeys.keys;
}; };
}; };

6
shared/ssh-keys.nix Normal file
View File

@@ -0,0 +1,6 @@
{
# Shared SSH public keys for all hosts
keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOk8iAnIaa1deoc7jw8YACPNVka1ZFJxhnU4G74TmS+p"
];
}