summaryrefslogtreecommitdiff
path: root/host/automatix.nix
blob: 9724b95479e033853e046c3ef2aeb46337074d13 (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
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
{ pkgs, ... }:

{
  imports = [ ./hardware/automatix.nix ];

  boot.loader.grub = {
    enable  = true;
    version = 2;
    device  = "/dev/sda";
  };

  networking = {
    hostName = "automatix";

    firewall = {
      allowedTCPPorts = [ 22 80 443 ];
    };
  };

  services = {
    gitea = {
      enable = true;
      database.type = "sqlite3";

      appName = "~/projects";
      domain  = "code.kummerlaender.eu";
      rootUrl = "https://code.kummerlaender.eu/";
      httpPort = 3000;

      extraConfig = ''
        [server]
        LANDING_PAGE = "explore"
        [service]
        DISABLE_REGISTRATION = true
        SHOW_REGISTRATION_BUTTON = false
        [api]
        ENABLE_SWAGGER_ENDPOINT = false
        [picture]
        DISABLE_GRAVATAR = true
        [other]
        SHOW_FOOTER_VERSION = false
        SHOW_FOOTER_TEMPLATE_LOAD_TIME = false
      '';
    };

    nginx = {
      enable = true;

      recommendedGzipSettings  = true;
      recommendedOptimisation  = true;
      recommendedProxySettings = true;
      recommendedTlsSettings   = true;

      virtualHosts."code.kummerlaender.eu" = {
        addSSL = true;
        enableACME = true;
        locations = {
          "/" = {
            proxyPass = "http://localhost:3000/";
          };
        };
      };
    };
  };
}