GoatCounter NixOS Module Options

Options

_module.args

services.goatcounter.enable

services.goatcounter.package

services.goatcounter.database.automigrate

services.goatcounter.database.backend

services.goatcounter.database.name

services.goatcounter.database.passwordFile

services.goatcounter.database.user

services.goatcounter.environmentFile

services.goatcounter.extraArgs

_module.args

Additional arguments passed to each module in addition to ones like lib, config, and pkgs, modulesPath.

This option is also available to all submodules. Submodules do not inherit args from their parent module, nor do they provide args to their parent module or sibling submodules. The sole exception to this is the argument name which is provided by parent modules to a submodule and contains the attribute name the submodule is bound to, or a unique generated name if it is not bound to an attribute.

Some arguments are already passed by default, of which the following cannot be changed with this option:

For NixOS, the default value for this option includes at least this argument:

Type: lazy attribute set of raw value

services.goatcounter.enable

Whether to enable enable the goatcounter service.

Type: boolean

Default: false

Example: true

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.package

The goatcounter package to use.

Type: package

Default: packages.default from the goatcounter flake

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.database.automigrate

Whether to automatically migrate the database schema.

Type: boolean

Default: false

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.database.backend

Database backend to use.

Type: one of “postgresql”, “sqlite”

Default: postgresql

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.database.name

Database name to connect to.

Type: string

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.database.passwordFile

Path to a file containing the password for the database user.

The service will use use LoadCredential to expose the file to the service using PGPASSFILE.

Should contain lines of the following format:

hostname:port:database:username:password

Must have permissions 0600 or less to be read by the user running goatcounter.

See PostgreSQL: Documentation: 16: 34.16. The Password File for more information.

Type: null or path

Default: null

Example: /var/lib/goatcounter.passwd

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.database.user

PostgreSQL user to use for database connection.

Type: string

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.environmentFile

Additional environment file as defined in systemd.exec(5).

Secrets like PGDATABASE and DBHOST may be passed to the service without adding them to the world-readable Nix store.

Note that this file needs to be available on the host on which goatcounter is running.

Type: null or path

Default: null

Example: /var/lib/goatcounter.env

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix

services.goatcounter.extraArgs

Extra command-line arguments to be passed to goatcounter serve.

By default, GoatCounter listens on port 80 and 443 and tries to generate an ACME/Let’s Encrypt certificate.

To run GoatCounter behind a proxy like NGINX, you can change the listening port with

-listen='*:8002'

and set

-tls=http

to disable certificate generation.

Type: list of string

Default: [ ]

Example:

[
  "-listen='*:8002'"
  "-tls=http"
  "-debug=all"
]

Declared by:

goatcounter-flake/nixos/modules/services/web-apps/goatcounter/default.nix