niksos/hosts/chmura/jacekpoz.pl.nix

49 lines
1.2 KiB
Nix

{
inputs,
pkgs,
...
}: let
port = 4827;
in {
services.caddy = {
enable = true;
virtualHosts = {
"jacekpoz.pl".extraConfig = ''
reverse_proxy localhost:${toString port}
'';
"jpoz.pl".extraConfig = ''
redir / https://jacekpoz.pl
redir /git https://jacekpoz.pl/posts/git-workflow.html
'';
"jacek.poziem.ski".extraConfig = ''
redir https://jacekpoz.pl
'';
};
};
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 = ''POZ_PORT="${toString port}" POZ_DIR="/srv/web/jacekpoz.pl"'';
User = "site";
Group = "site";
};
path = with pkgs; [
fastfetch
colorized-logs
];
};
}