modules: user: add publicKeys option

This commit is contained in:
teutat3s 2022-01-31 17:35:00 +01:00
parent 7589360e6d
commit fa03692511
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,11 @@ in
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
}; };
publicKeys = mkOption {
description = "User SSH public keys";
type = types.listOf types.path;
default = [ ];
};
fullName = mkOption { fullName = mkOption {
description = "User full name"; description = "User full name";
type = types.nullOr types.str; type = types.nullOr types.str;

View file

@ -19,6 +19,7 @@ in
extraGroups = [ "wheel" "docker" "input" "audio" "networkmanager" "lp" "scanner" ]; extraGroups = [ "wheel" "docker" "input" "audio" "networkmanager" "lp" "scanner" ];
initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else ""; initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else "";
shell = pkgs.zsh; shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [];
}; };
}; };
} }