Add admin user.

This commit is contained in:
Lorenzo Good 2025-01-26 19:21:36 -06:00
parent 5327a81d0b
commit b2595f1936
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0

View file

@ -0,0 +1,26 @@
{
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;
};
}