Skip to content

Commit 1ebb7d7

Browse files
nixos/gitea: add hmacKey support
1 parent 6dd2f02 commit 1ebb7d7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nixos/modules/services/misc/gitea.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,13 @@ in
239239
description = lib.mdDoc "Path to the git repositories.";
240240
};
241241

242+
camoHmacKeyFile = mkOption {
243+
type = types.nullOr types.str;
244+
default = null;
245+
example = "/var/lib/secrets/gitea/camoHmacKey";
246+
description = lib.mdDoc "Path to a file containing the camo HMAC key.";
247+
};
248+
242249
mailerPasswordFile = mkOption {
243250
type = types.nullOr types.str;
244251
default = null;
@@ -434,6 +441,10 @@ in
434441
LFS_JWT_SECRET = "#lfsjwtsecret#";
435442
};
436443

444+
camo = mkIf (cfg.camoHmacKeyFile != null) {
445+
HMAC_KEY = "#hmackey#";
446+
};
447+
437448
session = {
438449
COOKIE_NAME = lib.mkDefault "session";
439450
};
@@ -575,6 +586,10 @@ in
575586
${replaceSecretBin} '#lfsjwtsecret#' '${lfsJwtSecret}' '${runConfig}'
576587
''}
577588
589+
${lib.optionalString (cfg.camoHmacKeyFile != null) ''
590+
${replaceSecretBin} '#hmackey#' '${cfg.camoHmacKeyFile}' '${runConfig}'
591+
''}
592+
578593
${lib.optionalString (cfg.mailerPasswordFile != null) ''
579594
${replaceSecretBin} '#mailerpass#' '${cfg.mailerPasswordFile}' '${runConfig}'
580595
''}

0 commit comments

Comments
 (0)