modules: user: add publicKeys option

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

View file

@ -21,6 +21,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" "video" "networkmanager" "lp" "scanner" ]; extraGroups = [ "wheel" "docker" "input" "audio" "video" "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 [];
}; };
}; };
} }