Admin module: integrate with clan app

This commit is contained in:
Johannes Kirschbauer
2024-08-27 18:20:42 +02:00
parent 46a64862d7
commit f7cd4a2c0f
10 changed files with 109 additions and 15 deletions

View File

@@ -2,9 +2,12 @@
{
options.clan.admin = {
allowedKeys = lib.mkOption {
default = [ ];
type = lib.types.listOf lib.types.str;
default = { };
type = lib.types.attrsOf lib.types.str;
description = "The allowed public keys for ssh access to the admin user";
example = {
"key_1" = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...";
};
};
};
imports = [
@@ -12,6 +15,6 @@
../root-password
];
config = {
users.users.root.openssh.authorizedKeys.keys = config.clan.admin.allowedKeys;
users.users.root.openssh.authorizedKeys.keys = builtins.attrValues config.clan.admin.allowedKeys;
};
}