27 lines
639 B
Nix
27 lines
639 B
Nix
|
|
{
|
||
|
|
config,
|
||
|
|
lib,
|
||
|
|
foelib,
|
||
|
|
...
|
||
|
|
}: let
|
||
|
|
inherit (lib) mkIf mkEnableOption optionals;
|
||
|
|
cfg = config.foehammer.users.admin;
|
||
|
|
in {
|
||
|
|
options.foehammer.users.admin.enable = mkEnableOption "Enable a wheel admin user.";
|
||
|
|
config = mkIf cfg.enable {
|
||
|
|
users.users.admin = {
|
||
|
|
createHome = true;
|
||
|
|
description = "SSH Admin User.";
|
||
|
|
group = "admin";
|
||
|
|
|
||
|
|
extraGroups = ["wheel"] ++ optionals config.virtualisation.docker.enable ["docker"];
|
||
|
|
isNormalUser = true;
|
||
|
|
uid = 9999;
|
||
|
|
|
||
|
|
openssh.authorizedKeys.keys = foelib.getSSHKeys "foehammer";
|
||
|
|
};
|
||
|
|
|
||
|
|
users.groups.admin.gid = config.users.users.admin.uid;
|
||
|
|
};
|
||
|
|
}
|