summary refs log tree commit diff
path: root/fleet/hosts/trieste/web.nix
blob: d32fc44e8266c07f56d84dabc4d75d56ab6ddb28 (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
# 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.config = ''
    unfathomable.blue {
      import common
      respond / "the depths await"
      error 404
    }

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