helm/modules/services/ssh.nix

24 lines
556 B
Nix
Raw Normal View History

{ options, config, lib, ... }:
2019-08-06 10:56:54 -07:00
2020-03-28 22:48:43 -07:00
with lib;
with lib.my;
let cfg = config.modules.services.ssh;
in {
2020-03-28 22:48:43 -07:00
options.modules.services.ssh = {
enable = mkBoolOpt false;
2019-08-06 10:56:54 -07:00
};
config = mkIf cfg.enable {
2020-03-28 22:48:43 -07:00
services.openssh = {
enable = true;
challengeResponseAuthentication = false;
2020-03-28 22:48:43 -07:00
passwordAuthentication = false;
};
user.openssh.authorizedKeys.keys =
if config.user.name == "hlissner"
then [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB71rSnjuC06Qq3NLXQJwSz7jazoB+umydddrxL6vg1a henrik@lissner.net" ]
else [];
2020-03-28 22:48:43 -07:00
};
2019-08-06 10:56:54 -07:00
}