summaryrefslogtreecommitdiff
path: root/chaski/services/radicle.nix
blob: 62bb8d15c51f0371a570f27bd9c659d924ca3f94 (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
66
67
68
69
70
71
{ config, lib, pkgs, ... }:

{

  networking.firewall.allowedTCPPorts = [ 8776 ];

  services.nginx.virtualHosts."node.radicle.stuebinm.eu" = {
    enableACME = true;
    forceSSL = true;
    locations."/".proxyPass = "http://localhost:4444";
  };

  services.nginx.virtualHosts."radicle.stuebinm.eu" = {
    enableACME = true;
    forceSSL = true;
    locations."/nodes".tryFiles = "/index.html =404";
    root = pkgs.radicle-interface.override {
      config = {
        nodes = {
          defaultHttpdPort = 443;
          defaultLocalHttpdPort = 8080;
          defaultHttpdScheme = "https";
          defaultNodePort = 8776;
          pinned = [ {
            baseUrl = {
              hostname = "node.radicle.stuebinm.eu";
              port = 443;
              scheme = "https";
            };
          } ];
        };
        reactions = ["👍" "👎" "😄" "🎉" "🙁" "🚀" "👀"];
        projects.pinned = [ {
          name = "bahnhof.name";
          id = "rad:z3R2BH43TcvaMQgtk6bKHxzqfNP2W";
          baseUrl = {
            hostname = "node.radicle.stuebinm.eu";
            port =  443;
            scheme = "https";
          };
        } ];
      };
    };
  };

  systemd.services.radicle-httpd = {
    enable = true;
    wantedBy = [ "multi-user.target" ];
    serviceConfig = {
      Type = "simple";
      Restart = "always";
      MemoryMax = "1G";
      User = "radicle";
      Group = "radicle";
    };
    environment.RAD_HOME = "/var/lib/radicle";
    path = [ pkgs.heartwood pkgs.gitMinimal ];
    script = ''
      cd /var/lib/radicle
      radicle-httpd --listen 0.0.0.0:4444;
    '';
  };

  users.users.radicle = {
    group = "radicle";
    isSystemUser = true;
  };
  users.groups.radicle = {};

  environment.systemPackages = [ pkgs.heartwood ];
}