blob: e09a7e3e02366173a5697760572d910766dec569 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
{ options, config, lib, namespace, ... }:
with lib; with lib.${namespace}; let
cfg = config.${namespace}.services.ssh;
impermanence = config.${namespace}.system.impermanence;
in {
options.${namespace}.services.ssh = with types; {
enable = mkEnableOption "ssh server";
port = mkOption {
type = types.port;
default = 22;
description = "ssh server port";
};
};
config = mkIf cfg.enable {
services.openssh = {
enable = true;
ports = [ cfg.port ];
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
};
}
|