nixos-config/config/services/old-homepage.nix

51 lines
1.1 KiB
Nix
Raw Normal View History

2022-01-17 16:59:51 +01:00
{
2022-06-12 16:39:15 +01:00
nix-packages,
system,
2022-12-30 15:44:49 +01:00
pkgs,
2022-06-12 16:39:15 +01:00
...
}: let
2023-06-13 06:46:23 +01:00
inherit (pkgs) old-homepage;
2022-06-12 16:39:15 +01:00
in {
2022-01-17 17:01:38 +01:00
systemd.services.homepage-old = {
2022-01-17 16:59:51 +01:00
enable = true;
description = "darkkirb.de";
2022-09-30 16:46:21 +01:00
script = "${old-homepage}/homepage";
2022-01-17 16:59:51 +01:00
serviceConfig = {
2022-09-30 16:46:21 +01:00
WorkingDirectory = old-homepage;
2022-01-17 17:09:51 +01:00
EnvironmentFile = "/run/secrets/services/old-homepage";
2022-01-17 16:59:51 +01:00
};
2022-06-12 16:39:15 +01:00
wantedBy = ["multi-user.target"];
2022-01-17 16:59:51 +01:00
};
2022-08-26 16:28:14 +01:00
services.caddy.virtualHosts."darkkirb.de" = {
useACMEHost = "darkkirb.de";
2022-12-30 14:03:57 +01:00
logFormat = pkgs.lib.mkForce "";
2022-08-26 16:28:14 +01:00
extraConfig = ''
import baseConfig
reverse_proxy {
to http://localhost:3002
trusted_proxies private_ranges
}
'';
2022-01-17 16:59:51 +01:00
};
2022-08-26 16:28:14 +01:00
services.caddy.virtualHosts."static.darkkirb.de" = {
useACMEHost = "darkkirb.de";
2022-12-30 14:03:57 +01:00
logFormat = pkgs.lib.mkForce "";
2022-08-26 16:28:14 +01:00
extraConfig = ''
import baseConfig
2022-08-28 16:20:46 +01:00
rewrite * /file/darkkirb-de{path}
2022-08-26 17:00:06 +01:00
2022-08-26 16:28:14 +01:00
reverse_proxy {
to https://f000.backblazeb2.com
header_up Host {upstream_hostport}
transport http {
versions 1.1 2 3
}
}
'';
2022-01-17 15:54:37 +01:00
};
2022-06-12 16:39:15 +01:00
sops.secrets."services/old-homepage" = {};
2022-01-17 15:54:37 +01:00
}