blob: 9d0a6819f230f65d98c1f0c16dfed211fb152b22 (
plain) (
blame)
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
|
{ config, pkgs, lib, ... }:
let
cfg = config.vuizvui.user.profpatsch.server;
in
{
imports = [
./base.nix
];
options.vuizvui.user.profpatsch.server.sshPort = lib.mkOption {
description = "ssh port";
# TODO: replace with types.intBetween https://github.com/NixOS/nixpkgs/pull/27239
type = with lib.types; addCheck int (x: x >= 0 && x <= 65535);
default = 6879;
};
config = {
boot.cleanTmpDir = true;
programs.mosh.enable = true;
services.openssh = {
enable = true;
listenAddresses = [ { addr = "0.0.0.0"; port = cfg.sshPort; } ];
};
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [ cfg.sshPort ];
};
};
}
|