ark/hosts/wolumonde/modules/guestbook.nix

34 lines
812 B
Nix
Raw Normal View History

2024-08-23 17:18:24 +03:00
{
pkgs,
inputs,
...
}: let
GUESTBOOK_WEBSITE_URI = "https://gaze.systems";
pkg = inputs.blog.packages.${pkgs.system}.guestbook;
2024-08-23 18:27:34 +03:00
port = 8080;
2024-08-23 17:18:24 +03:00
in {
users.users.guestbook = {
isSystemUser = true;
group = "guestbook";
};
users.groups.guestbook = {};
systemd.services.guestbook = {
description = "guestbook";
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = {
User = "guestbook";
ExecStart = "${pkg}/bin/guestbook";
Restart = "on-failure";
RestartSec = 5;
WorkingDirectory = "/var/lib/guestbook";
Environment = "HOME=/var/lib/guestbook";
EnvironmentFile = pkgs.writeText "guestbook-env" ''
GUESTBOOK_WEBSITE_URI="${GUESTBOOK_WEBSITE_URI}"
PORT=${toString port}
'';
};
};
}