Add goatcounter.
This commit is contained in:
parent
407928712c
commit
f164449faf
4 changed files with 55 additions and 0 deletions
45
common/services/goatcounter.nix
Normal file
45
common/services/goatcounter.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
|
||||
cfg = config.foehammer.services.goatcounter;
|
||||
in {
|
||||
options.foehammer.services.goatcounter = {
|
||||
enable = mkEnableOption "Enable goatcounter server";
|
||||
|
||||
port = mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8223;
|
||||
description = ''
|
||||
What external port to serve over.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.users.goatcounter = {
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
group = "goatcounter";
|
||||
};
|
||||
users.groups.goatcounter = {};
|
||||
|
||||
systemd.services.goatcounter = {
|
||||
serviceConfig = {
|
||||
User = "goatcounter";
|
||||
DynamicUser = lib.mkForce false;
|
||||
};
|
||||
};
|
||||
|
||||
services.goatcounter = {
|
||||
enable = true;
|
||||
proxy = true;
|
||||
address = "0.0.0.0";
|
||||
port = cfg.port;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue