mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
20 lines
668 B
Nix
20 lines
668 B
Nix
{ self, lib, config, ... }:
|
|
{
|
|
options.swarselsystems.modules.server.ssh = lib.mkEnableOption "enable ssh on server";
|
|
config = lib.mkIf config.swarselsystems.modules.server.ssh {
|
|
services.openssh = {
|
|
enable = true;
|
|
};
|
|
users.users."${config.swarselsystems.mainUser}".openssh.authorizedKeys.keyFiles = [
|
|
(self + /secrets/keys/ssh/yubikey.pub)
|
|
(self + /secrets/keys/ssh/magicant.pub)
|
|
];
|
|
users.users.root.openssh.authorizedKeys.keyFiles = [
|
|
(self + /secrets/keys/ssh/yubikey.pub)
|
|
(self + /secrets/keys/ssh/magicant.pub)
|
|
];
|
|
security.sudo.extraConfig = ''
|
|
Defaults env_keep+=SSH_AUTH_SOCK
|
|
'';
|
|
};
|
|
}
|