summary refs log tree commit diff stats
path: root/system/services/taskserver/default.nix
blob: 4ee9a314b940702484468fce8e909d3234b28ba6 (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
{...}: let
  taskStore = "/var/lib/taskserver";
in {
  imports = [
    ./connected_users.nix
  ];
  services.taskserver = {
    enable = true;
    pki.manual = {
      ca.cert = ./certs/ca.cert.pem;
      server = {
        cert = "${taskStore}/fullchain.pem";
        key = "${taskStore}/key.pem";
      };
    };

    debug = false;
    ipLog = false;
    trust = "strict";

    organisations = import ./organisations.nix;
    openFirewall = true;
    fqdn = "taskserver.vhack.eu";

    # This should tell taskd to bind to both ipv6 and ipv4 domains:
    listenHost = "::";
  };
  security.acme.certs.taskserver = {
    domain = "taskserver.vhack.eu";
    postRun =
      /*
      bash
      */
      ''
        set -x
        rm "${taskStore}/key.pem"
        rm "${taskStore}/fullchain.pem"

        cp key.pem "${taskStore}";
        cp fullchain.pem "${taskStore}";

        chown taskd:taskd "${taskStore}/key.pem"
        chown taskd:taskd "${taskStore}/fullchain.pem"
      '';
  };
}