aboutsummaryrefslogtreecommitdiff
path: root/modules/services/nixos/ssh.nix
blob: b594a2d25a706f2a489df083961100eb6344ed5a (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
{
  config,
  lib,
  ...
}: let
  cfg = config.collinux.services.networking.sshd;
in
  lib.mkIf cfg.enable {
    services.openssh = {
      enable = true;
      openFirewall = true;
      hostKeys = [
        {
          path = "/etc/ssh/ssh_host_ed25519_key";
          type = "ed25519";
        }
      ];
      settings = {
        PermitRootLogin = "prohibit-password";
        PasswordAuthentication = false;
      };
    };

    services.tailscale.extraSetFlags = lib.optional config.services.tailscale.enable "--ssh=true";
  }