44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{
|
|
inputs,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
port = 4827;
|
|
in {
|
|
services.caddy = {
|
|
enable = true;
|
|
virtualHosts."jacekpoz.pl".extraConfig = ''
|
|
reverse_proxy localhost:${toString port}
|
|
'';
|
|
virtualHosts."jpoz.pl".extraConfig = ''
|
|
redir / https://jacekpoz.pl
|
|
redir /git https://jacekpoz.pl/posts/git-workflow.html
|
|
'';
|
|
};
|
|
|
|
users.groups.site = {};
|
|
|
|
users.users.site = {
|
|
isSystemUser = true;
|
|
group = "site";
|
|
};
|
|
|
|
systemd.services.pozback = {
|
|
description = "The backend for jacekpoz.pl";
|
|
wantedBy = ["default.target"];
|
|
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${inputs.pozsite.packages.${pkgs.system}.pozback}/bin/back";
|
|
Restart = "on-failure";
|
|
Environment = ''ROCKET_PORT="${toString port}" ROCKET_WEB_DIR="/srv/web/jacekpoz.pl"'';
|
|
User = "site";
|
|
Group = "site";
|
|
};
|
|
|
|
path = with pkgs; [
|
|
fastfetch
|
|
colorized-logs
|
|
];
|
|
};
|
|
}
|