aboutsummaryrefslogtreecommitdiffstats
path: root/modules/common/vhack/default.nix
blob: 5821ed92e52cae0a6731c6bb2e0dd6bde86eca51 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  config,
  ...
}: {
  vhack = {
    anubis.enable = true;

    services.mandb.enable = true;
    users = {
      enable = true;
      users = [
        {
          name = "soispha";
          groups = ["wheel"];
          uid = 1000;
          hashedPassword = "$y$jFT$3.8XmUyukZvpExMUxDZkI.$IVrJgm8ysNDF/0vDD2kF6w73ozXgr1LMVRNN4Bq7pv1";
          sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz cardno:000F_18F83532";
        }
        {
          name = "jaki";
          uid = 1001;
          groups = ["wheel"];
          hashedPassword = "$y$jFT$KpFnahVCE9JbE.5P3us8o.$ZzSxCusWqe3sL7b6DLgOXNNUf114tiiptM6T8lDxtKC";
          sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILn7Oumr5IYtTTIKRFvDnofGXXiDLBQE9jVF+7UE+4G5 vhack.eu";
        }
      ];
    };

    postgresql.enable = true;
    fail2ban.enable = true;
    nixconfig.enable = true;
    openssh.enable = true;

    # A local dns server is not _necessary_ but it helps, especially with resolving the
    # local zones we advertise via nsd.
    unbound.enable = true;

    # Both servers host the same zones, because why not, it at least improves redundancy
    nsd = {
      enable = true;
      openFirewall = true;
      interfaces = [
        (builtins.head config.networking.interfaces.eth0.ipv4.addresses).address
        (builtins.head config.networking.interfaces.eth0.ipv6.addresses).address
      ];
      zones = import ../../../zones {inherit lib;};
    };

    persist = {
      enable = true;

      directories = [
        "/etc/nixos"
        "/var/lib/systemd"
        "/var/log"
      ];
    };
  };
  boot.tmp.cleanOnBoot = true;
  zramSwap.enable = true;
}