blob: cfe78833e085a5cb271f30c95310501db746178d (
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
29
30
31
32
33
34
35
36
37
38
39
|
{
config,
lib,
...
}: let
cfg = config.collinux.services.networking.sshd;
in {
config = lib.mkIf cfg.enable {
services.openssh = {
enable = true;
openFirewall = false;
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
listenAddresses = [
{
addr = cfg.bind_host;
port = 22;
}
];
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
};
};
systemd.services."openssh" = lib.mkIf config.collinux.services.networking.networkd.enable {
after = lib.mkAfter ["network-online.target"];
wants = lib.mkAfter ["network-online.target"];
};
services.tailscale.extraSetFlags = lib.optional config.services.tailscale.enable "--ssh=true";
};
}
|