Skip to content

Commit

Permalink
add a goatcounter systemd service
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Dec 23, 2020
1 parent 849776e commit 4228648
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions gitea/configuration.nix
Expand Up @@ -254,4 +254,25 @@ in {
## goatcounter
users.groups.goatcounter = { };
users.users.goatcounter = { extraGroups = [ "goatcounter" ]; };

systemd.services.goatcounter = {
description = "Privacy-preserving web analytics";
documentation = [ "https://github.com/zgoat/goatcounter" ];

enable = true;

wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];

path = [ goatcounter ];
preStart =
"goatcounter migrate -db 'postgres://user=goatcounter dbname=goatcounter host=/run/postgresql'";
script =
"goatcounter serve -db 'postgres://user=goatcounter dbname=goatcounter host=/run/postgresql' -listen localhost:8081 -tls none";

serviceConfig = {
User = "goatcounter";
Group = "goatcounter";
};
};
}

0 comments on commit 4228648

Please sign in to comment.