dotfiles/modules/services/ssh.nix

37 lines
675 B
Nix
Raw Normal View History

2022-01-11 18:44:40 +01:00
{ options, config, lib, pkgs, ... }:
with lib;
#with lib.my;
let
cfg = config.modules.services.ssh;
in {
options.modules.services.ssh = {
enable = mkOption {
type = types.bool;
default = false;
description = "Provide system SSH support though OpenSSH.";
};
2023-04-21 15:40:27 +02:00
requirePassword = mkOption {
type = types.bool;
default = true;
};
2022-01-11 18:44:40 +01:00
};
config = mkIf cfg.enable {
2022-04-23 03:01:00 +02:00
services.openssh = {
enable = true;
2023-02-25 13:50:15 +01:00
settings = {
PasswordAuthentication = cfg.requirePassword;
PermitRootLogin = "no";
};
2022-04-23 03:01:00 +02:00
};
2023-04-24 23:43:34 +02:00
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
2022-01-11 18:44:40 +01:00
};
}