aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/by-name/server2/configuration.nix
blob: d772bcd7424744f6f0d7e5b112a0d13ebe1c2dfe (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
  lib,
  pkgs,
  ...
}: {
  imports = [
    ./networking.nix # network configuration that just works
    ./hardware.nix
  ];

  sils = {
    gallery = {
      enable = true;
      domain = "gallery.s-schoeffel.de";
    };
  };

  vhack = {
    atuin-sync = {
      enable = true;
      fqdn = "atuin-sync.vhack.eu";
    };
    backup = {
      enable = true;
      privateSshKey = ./secrets/backup/backupssh.age;
      privatePassword = ./secrets/backup/backuppass.age;
      user = "u384702-sub3";
    };

    monitoring = {
      enable = true;
      grafana = {
        fqdn = "grafana.vhack.eu";

        contactPoints = ["admin@vhack.eu"];
        adminPassword = ./secrets/grafana/adminPassword.age;
        secretKey = ./secrets/grafana/secretKey.age;
      };
      scrutiny.fqdn = "scrutiny.vhack.eu";
    };

    dns = {
      enable = true;
      openFirewall = true;
      interfaces = [
        "185.16.61.132"
        "2a03:4000:a:106::1"
      ];
      zones = import ../../../zones {inherit lib;};
    };
    etesync = {
      enable = true;
      secretFile = ./secrets/etesync/secret_file.age;
    };
    fail2ban.enable = true;
    git-server = {
      enable = true;
      domain = "git.foss-syndicate.org";
      gitolite.adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz cardno:000F_18F83532";
    };
    invidious-router = {
      enable = true;
      domain = "invidious-router.vhack.eu";
      extraDomains = [
        "video.fosswelt.org"
        "invidious-router.sils.li"
      ];
    };
    mail = {
      enable = true;
      fqdn = "mail.foss-syndicate.org";
    };
    nextcloud = {
      enable = true;
      package = pkgs.nextcloud33;
      hostname = "nextcloud.vhack.eu";
      adminpassFile = ./secrets/nextcloud/adminpassFile.age;
    };

    nginx = {
      enable = true;
      redirects = {
        "source.foss-syndicate.org" = "https://git.foss-syndicate.org/vhack.eu/nixos-server";
        "source.vhack.eu" = "https://source.foss-syndicate.org";
      };
    };
    nixconfig.enable = true;
    openssh.enable = true;
    persist = {
      enable = true;
      directories = [
        "/var/log"
      ];
    };
    redlib.enable = true;
    rust-motd.enable = true;
    sharkey = {
      enable = true;
      fqdn = "sharkey.vhack.eu";
      settings = {
        id = "aidx";

        maxNoteLength = 8192;
        maxFileSize = 1024 * 1024 * 1024;
        proxyRemoteFiles = true;

        # > At the suggestion of Sharkey maintainers,
        # > this allows the server to run multiple workers
        # > and without this (and postgres tuning), the instance runs slowly.
        # Copied from: https://github.com/sodiboo/system/blob/b63c7b27f49043e8701b3ff5e1441cd27d5a2fff/sharkey.mod.nix#L21-L23
        clusterLimit = 3;

        signToActivityPubGet = true;
        CheckActivityPubGetSigned = false;
      };
    };
    taskchampion-sync = {
      enable = true;
      fqdn = "taskchampion.vhack.eu";
    };
    users.enable = true;
  };

  boot.tmp.cleanOnBoot = true;
  zramSwap.enable = true;
  networking.hostName = "server2";
  networking.domain = "vhack.eu";

  system.stateVersion = "24.11";
}