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

48 lines
1 KiB
Nix
Raw Normal View History

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