2020-10-01 15:46:04 -07:00
|
|
|
{ options, config, lib, ... }:
|
2019-08-06 10:56:54 -07:00
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
with lib;
|
2020-10-01 15:46:04 -07:00
|
|
|
with lib.my;
|
|
|
|
let cfg = config.modules.services.ssh;
|
|
|
|
in {
|
2020-03-28 22:48:43 -07:00
|
|
|
options.modules.services.ssh = {
|
2020-10-01 15:46:04 -07:00
|
|
|
enable = mkBoolOpt false;
|
2019-08-06 10:56:54 -07:00
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
config = mkIf cfg.enable {
|
2020-03-28 22:48:43 -07:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
challengeResponseAuthentication = false;
|
2020-03-28 22:48:43 -07:00
|
|
|
passwordAuthentication = false;
|
|
|
|
};
|
|
|
|
|
2021-01-19 22:30:43 -08:00
|
|
|
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
|
|
|
}
|