Add admin user.
This commit is contained in:
parent
5327a81d0b
commit
b2595f1936
1 changed files with 26 additions and 0 deletions
26
nixos/common/users/admin.nix
Normal file
26
nixos/common/users/admin.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue