feat(users): define authorized SSH keys

This commit is contained in:
Sk7Str1p3 2026-07-25 17:21:55 +00:00
parent 240771af14
commit 35368fc6f9
Signed by: Sk7Str1p3
SSH key fingerprint: SHA256:GcXqjfo0IHK280c6aH9o5SmcOWyqMS8gjfOtDQ3gr/Q
2 changed files with 10 additions and 5 deletions

View file

@ -8,6 +8,7 @@
- `extraGroups`: groups (optionally)
- `shell`: User's shell
- `session`: User's default graphical session (optionally)
- `sshKeys`: User's authorized SSH keys (optionally)
Session must have format of "{type}:{session}" where type is one of `co` (short for "compositor") and `de` (short for "desktop environment").
This `type` is actually important, because it depends where nix will search corresponding option for enabling your session.
@ -64,6 +65,7 @@ lib.foldl' (acc: obj: lib.recursiveUpdate acc obj) { } (
isNormalUser = true;
shell = pkgs."${cfg.shell}";
extraGroups = cfg.extraGroups or [ ];
openssh.authorizedKeys.keys = cfg.sshKeys or [ ];
};
}) cfg.usersList)