17 lines
390 B
Nix
17 lines
390 B
Nix
#{ config, pkgs, lib, ... }:
|
|
let
|
|
ssh_data = import ../data/ssh.nix;
|
|
in {
|
|
services.openssh = {
|
|
enable = true;
|
|
settings = {
|
|
PasswordAuthentication = true;
|
|
PermitRootLogin = "no";
|
|
AllowUsers = ssh_data.ssh_users;
|
|
};
|
|
};
|
|
|
|
users.users = builtins.mapAttrs (username: value: {
|
|
openssh.authorizedKeys.keys = ssh_data.keys.${username};
|
|
}) ssh_data.keys;
|
|
}
|