You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
infra/modules/users.nix

15 lines
396 B

{ config, lib, pkgs, key_mappings, ... }:
let
auth_keys = lib.mapAttrs (_: u: u.auth) key_mappings;
sudo_keys = lib.concatLists
(lib.attrValues
(lib.mapAttrs (_: u: u.sudo) key_mappings));
in {
users.users = {
root.openssh.authorizedKeys.keys = sudo_keys;
} // (lib.mapAttrs (name: keys: {
isNormalUser = true;
openssh.authorizedKeys.keys = keys;
}) auth_keys);
}