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:
lib
: The nixpkgs library.
config
: The results of all options after merging the
values from all modules together.
options
: The options declared in all
modules.
specialArgs
: The specialArgs
argument
passed to evalModules
.
All attributes of specialArgs
Whereas option values can generally depend on other option values
thanks to laziness, this does not apply to imports
, which
must be computed statically before anything else.
For this reason, callers of the module system can provide
specialArgs
which are available during import
resolution.
For NixOS, specialArgs
includes
modulesPath
, which allows you to import extra modules from
the nixpkgs package tree without having to somehow make the module aware
of the location of the nixpkgs
or NixOS directories.
{ modulesPath, ... }: {
imports = [
(modulesPath + "/profiles/minimal.nix")
];
}
For NixOS, the default value for this option includes at least this argument:
pkgs
: The nixpkgs package set according to the
nixpkgs.pkgs
option.
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