31 lines
596 B
Nix
Executable file
31 lines
596 B
Nix
Executable file
{ options, config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.modules.services.ssh;
|
|
in {
|
|
options.modules.services.ssh = {
|
|
enable = mkEnableOption "enable openssh, a server for remote shell access";
|
|
|
|
requirePassword = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.openssh = {
|
|
enable = true;
|
|
|
|
settings = {
|
|
PasswordAuthentication = cfg.requirePassword;
|
|
PermitRootLogin = "no";
|
|
};
|
|
};
|
|
|
|
programs.gnupg.agent = {
|
|
enable = true;
|
|
enableSSHSupport = true;
|
|
};
|
|
};
|
|
}
|