ark/hosts/wolumonde/modules/blog.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2022-08-11 02:57:40 +03:00
{
pkgs,
inputs,
...
2024-08-23 17:18:24 +03:00
}: let
PUBLIC_BASE_URL = "https://gaze.systems";
pkg = inputs.blog.packages.${pkgs.system}.default.overrideAttrs (old: {
inherit PUBLIC_BASE_URL;
GUESTBOOK_BASE_URL = "http://localhost:5173";
});
port = 3000;
in {
users.users.website = {
isSystemUser = true;
group = "website";
};
users.groups.website = {};
systemd.services.website = {
description = "website";
wantedBy = ["multi-user.target"];
after = ["network.target" "guestbook.service"];
serviceConfig = {
User = "website";
ExecStart = "${pkg}/bin/website";
Restart = "on-failure";
RestartSec = 5;
WorkingDirectory = "/var/lib/website";
Environment = "HOME=/var/lib/website";
EnvironmentFile = pkgs.writeText "website-env" ''
ORIGIN="${PUBLIC_BASE_URL}"
PORT=${toString port}
'';
};
};
2022-08-11 02:57:40 +03:00
services.nginx.virtualHosts."gaze.systems" = {
2023-05-08 23:09:44 +03:00
useACMEHost = "gaze.systems";
2022-08-11 02:57:40 +03:00
forceSSL = true;
2024-08-23 17:18:24 +03:00
locations."/" = {
proxyPass = "http://localhost:${toString port}";
};
2022-08-11 02:57:40 +03:00
};
}