28 lines
623 B
Nix
28 lines
623 B
Nix
|
{ config, lib, ... }:
|
||
|
let
|
||
|
cfg = config.kropcloud.admin;
|
||
|
in
|
||
|
{
|
||
|
options.kropcloud.admin = {
|
||
|
user = lib.mkOption {
|
||
|
type = lib.types.str;
|
||
|
default = "krop";
|
||
|
description = "Name of the admin user to be created.";
|
||
|
};
|
||
|
sshKeys = lib.mkOption {
|
||
|
type = lib.types.listOf lib.types.str;
|
||
|
default = [ ];
|
||
|
description = "List of SSH public keys to authorize for the admin user.";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = {
|
||
|
# Define the admin user
|
||
|
users.users.${cfg.user} = {
|
||
|
isNormalUser = true;
|
||
|
extraGroups = [ "wheel" ];
|
||
|
openssh.authorizedKeys.keys = cfg.sshKeys;
|
||
|
};
|
||
|
};
|
||
|
}
|