Set users and ssh auth keys for guest nodes
This commit is contained in:
parent
86fcab13a9
commit
a6a0f2650d
1 changed files with 45 additions and 0 deletions
45
modules/utils/server-node-users.nix
Normal file
45
modules/utils/server-node-users.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.serverUsers;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.serverUsers = {
|
||||||
|
enable = lib.mkEnableOption "Set users for server hosts";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
users = {
|
||||||
|
|
||||||
|
# If set to false, the contents of the user and group files will simply
|
||||||
|
# be replaced on system activation.
|
||||||
|
# This also holds for the user passwords.
|
||||||
|
# All changed passwords will be reset according
|
||||||
|
# to the `users.users` configuration on activation.
|
||||||
|
mutableUsers = false;
|
||||||
|
|
||||||
|
users.root = {
|
||||||
|
hashedPassword = "!";
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhiGLc/whCY3lCmDiRlYnMJOLiO/gvcRj/sKVEFVAhQ pazpi@deadbeef"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.pazpi = {
|
||||||
|
isNormalUser = true;
|
||||||
|
hashedPassword = "$y$j9T$oWLCV1hnGPyOGabMfAS3p1$/iwouRZGwQXcv6IHnLuT3I9.pmeXNpcHxq.b8xfitr1";
|
||||||
|
shell = pkgs.bash;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhiGLc/whCY3lCmDiRlYnMJOLiO/gvcRj/sKVEFVAhQ pazpi@deadbeef"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue