Files
nixos/services/ssh.nix
Simon Gardling 7721c9d3a2
Some checks failed
Build and Deploy / mreow (push) Successful in 1m58s
Build and Deploy / yarn (push) Successful in 47s
Build and Deploy / muffin (push) Failing after 30s
ssh: remove desktop key
2026-04-23 20:23:37 -04:00

39 lines
735 B
Nix

{
config,
lib,
pkgs,
site_config,
username,
...
}:
{
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
AllowUsers = [
username
"root"
];
PasswordAuthentication = false;
PermitRootLogin = "yes"; # for deploying configs
};
};
systemd.tmpfiles.rules = [
"Z /etc/ssh 755 root root"
"Z /etc/ssh/ssh_host_* 600 root root"
];
users.users.${username}.openssh.authorizedKeys.keys = [
site_config.ssh_keys.laptop
];
# used for deploying configs to server
users.users.root.openssh.authorizedKeys.keys =
config.users.users.${username}.openssh.authorizedKeys.keys
++ [
site_config.ssh_keys.ci_deploy
];
}