diff options
author | Graham Christensen <graham@grahamc.com> | 2021-12-17 11:14:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 11:14:08 -0500 |
commit | 06edb74413eb4e4ac56921ef2c038d8f106b15df (patch) | |
tree | 897b78ed67fd8ffb0938fc85f52a496ff9785e7c /nixos/modules/services/misc/gitea.nix | |
parent | 4edd5c91ca09665e33f705d280a4d9f7f093605f (diff) | |
parent | e67a646a925bc3cda86101a3f3afb81db3030ef5 (diff) | |
download | nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.gz nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.bz2 nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.lz nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.xz nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.zst nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.zip |
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
Diffstat (limited to 'nixos/modules/services/misc/gitea.nix')
-rw-r--r-- | nixos/modules/services/misc/gitea.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 022a73c2b59..0096286701f 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.services.gitea; + opt = options.services.gitea; gitea = cfg.package; pg = config.services.postgresql; useMysql = cfg.database.type == "mysql"; @@ -51,6 +52,7 @@ in log = { rootPath = mkOption { default = "${cfg.stateDir}/log"; + defaultText = literalExpression ''"''${config.${opt.stateDir}}/log"''; type = types.str; description = "Root path for log files."; }; @@ -84,6 +86,11 @@ in port = mkOption { type = types.port; default = (if !usePostgresql then 3306 else pg.port); + defaultText = literalExpression '' + if config.${opt.database.type} != "postgresql" + then 3306 + else config.${options.services.postgresql.port} + ''; description = "Database host port."; }; @@ -130,6 +137,7 @@ in path = mkOption { type = types.str; default = "${cfg.stateDir}/data/gitea.db"; + defaultText = literalExpression ''"''${config.${opt.stateDir}}/data/gitea.db"''; description = "Path to the sqlite3 database file."; }; @@ -166,6 +174,7 @@ in backupDir = mkOption { type = types.str; default = "${cfg.stateDir}/dump"; + defaultText = literalExpression ''"''${config.${opt.stateDir}}/dump"''; description = "Path to the dump files."; }; }; @@ -199,6 +208,7 @@ in contentDir = mkOption { type = types.str; default = "${cfg.stateDir}/data/lfs"; + defaultText = literalExpression ''"''${config.${opt.stateDir}}/data/lfs"''; description = "Where to store LFS files."; }; }; @@ -212,6 +222,7 @@ in repositoryRoot = mkOption { type = types.str; default = "${cfg.stateDir}/repositories"; + defaultText = literalExpression ''"''${config.${opt.stateDir}}/repositories"''; description = "Path to the git repositories."; }; |