Skip to content

Forgejo

services.forgejo.customDir

Base directory for custom templates and other options.

If {option}services.forgejo.useWizard is disabled (default), this directory will also hold secrets and the resulting {file}app.ini config at runtime.

Type: string

Default

"${config.services.forgejo.stateDir}/custom"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.createDatabase

Whether to create a local database automatically. Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.host

Database host address. Type: string

Default

"127.0.0.1"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.name

Database name. Type: string

Default

"forgejo"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.passwordFile

A file containing the password corresponding to {option}services.forgejo.database.user.

Type: null or path

Default

null

Example

"/run/keys/forgejo-dbpassword"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.path

Path to the sqlite3 database file. Type: string

Default

"${config.services.forgejo.stateDir}/data/forgejo.db"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.port

Database host port. Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default

if config.services.forgejo.database.type != "postgresql"then 3306else 5432

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.socket

Path to the unix socket file to use for authentication. Type: null or path

Default

null

Example

"/run/mysqld/mysqld.sock"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.type

Database engine to use. Type: one of "sqlite3", "mysql", "postgres"

Default

"sqlite3"

Example

"mysql"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.database.user

Database user. Type: string

Default

"forgejo"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.dump.backupDir

Path to the directory where the dump archives will be stored. Type: string

Default

"${config.services.forgejo.stateDir}/dump"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.dump.enable

Whether to enable periodic dumps via the built-in {command}dump command. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.dump.file

Filename to be used for the dump. If null a default name is chosen by forgejo. Type: null or string

Default

null

Example

"forgejo-dump"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.dump.interval

Run a Forgejo dump at this interval. Runs by default at 04:31 every day.

The format is described in {manpage}systemd.time(7).

Type: string

Default

"04:31"

Example

"hourly"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.dump.type

Archive format used to store the dump file. Type: one of "zip", "tar", "tar.sz", "tar.gz", "tar.xz", "tar.bz2", "tar.br", "tar.lz4", "tar.zst"

Default

"zip"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.enable

Whether to enable Forgejo, a software forge. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.group

Group under which Forgejo runs. Type: string

Default

"forgejo"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.lfs.contentDir

Where to store LFS files. Type: string

Default

"${config.services.forgejo.stateDir}/data/lfs"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.lfs.enable

Enables git-lfs support. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.package

The forgejo package to use. Type: package

Default

pkgs.forgejo

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.repositoryRoot

Path to the git repositories. Type: string

Default

"${config.services.forgejo.stateDir}/repositories"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.secrets

This is a small wrapper over systemd's LoadCredential.

It takes the same sections and keys as {option}services.forgejo.settings, but the value of each key is a path instead of a string or bool.

The path is then loaded as credential, exported as environment variable and then feed through https://codeberg.org/forgejo/forgejo/src/branch/forgejo/contrib/environment-to-ini/environment-to-ini.go.

It does the required environment variable escaping for you.

::: {.note} Keys specified here take priority over the ones in {option}services.forgejo.settings! :::

Type: attribute set of attribute set of path

Default

{ }

Example

{metrics = {TOKEN = "/run/keys/forgejo-metrics-token";};camo = {HMAC_KEY = "/run/keys/forgejo-camo-hmac";};service = {HCAPTCHA_SECRET = "/run/keys/forgejo-hcaptcha-secret";HCAPTCHA_SITEKEY = "/run/keys/forgejo-hcaptcha-sitekey";};}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings

Free-form settings written directly to the app.ini configfile file. Refer to https://forgejo.org/docs/latest/admin/config-cheat-sheet/ for supported values.

Type: attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string))

Default

{ }

Example

{DEFAULT = {RUN_MODE = "dev";};"cron.sync_external_users" = {RUN_AT_START = true;SCHEDULE = "@every 24h";UPDATE_EXISTING = true;};mailer = {ENABLED = true;MAILER_TYPE = "sendmail";FROM = "do-not-reply@example.org";SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";};other = {SHOW_FOOTER_VERSION = false;};}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.log.LEVEL

General log level. Type: one of "Trace", "Debug", "Info", "Warn", "Error", "Critical"

Default

"Info"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.log.ROOT_PATH

Root path for log files. Type: string

Default

"${config.services.forgejo.stateDir}/log"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.DISABLE_SSH

Disable external SSH feature. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.DOMAIN

Domain name of your server. Type: string

Default

"localhost"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.HTTP_ADDR

Listen address. Must be a path when using a unix socket. Type: string or path

Default

if lib.hasSuffix "+unix" cfg.settings.server.PROTOCOL then "/run/forgejo/forgejo.sock" else "0.0.0.0"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.HTTP_PORT

Listen port. Ignored when using a unix socket. Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default

3000

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.PROTOCOL

Listen protocol. +unix means "over unix", not "in addition to." Type: one of "http", "https", "fcgi", "http+unix", "fcgi+unix"

Default

"http"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.ROOT_URL

Full public URL of Forgejo server. Type: string

Default

"http://${config.services.forgejo.settings.server.DOMAIN}:${toString config.services.forgejo.settings.server.HTTP_PORT}/"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.SSH_PORT

SSH port displayed in clone URL. The option is required to configure a service when the external visible port differs from the local listening port i.e. if port forwarding is used.

Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default

22

Example

2222

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.server.STATIC_ROOT_PATH

Upper level of template and static files path. Type: string or path

Default

config.services.forgejo.package.data

Example

"/var/lib/forgejo/data"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.settings.session.COOKIE_SECURE

Marks session cookies as "secure" as a hint for browsers to only send them via HTTPS. This option is recommend, if Forgejo is being served over HTTPS.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.stateDir

Forgejo data directory. Type: string

Default

"/var/lib/forgejo"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.useWizard

Whether to use the built-in installation wizard instead of declaratively managing the {file}app.ini config file in nix.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix

services.forgejo.user

User account under which Forgejo runs. Type: string

Default

"forgejo"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix