summary refs log tree commit diff
path: root/fleet/hosts/trieste/web.nix
blob: 63d59d8627f294058d97b1d0f568ac1861238bd7 (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
# SPDX-FileCopyrightText: V <v@unfathomable.blue>
# SPDX-License-Identifier: OSL-3.0

{ pkgs, ... }:

{
  systemd.tmpfiles.rules = [
    "d /var/lib/www - git git"
  ];

  declarative.git.repositories.ripple-website.hooks.post-receive = [
    (pkgs.writeShellScript "update-ripple-website" ''
      nix-build ${./build-from-git.nix} \
        --argstr repo /var/lib/git/ripple-website \
        -o /var/lib/www/ripple
    '')
  ];

  services.caddy.extraConfig = ''
    unfathomable.blue {
      import common
      route {
        respond / "the depths await"
        error 404
      }
    }

    ripple.unfathomable.blue {
      import common
      root * /var/lib/www/ripple
      file_server
    }
  '';
}