fix(nix): convert boolean env vars to "true"/"false" strings instead of "1"/"0"

The archiveAll and archiveReadOnly options were using toString which converts
booleans to "1"/"0", but the CLI expects "true"/"false" strings.

This caused startup errors like:
  error: invalid value '1' for '--archive-all'
    [possible values: true, false]

Changed both to use explicit if/then/else conversion to match CLI expectations.
This commit is contained in:
DanConwayDev
2026-01-12 22:53:05 +00:00
parent 51751d59f3
commit d399bd0bcf
+2 -2
View File
@@ -290,7 +290,7 @@ let
toString cfg.rejectedColdIndexExpirySecs;
NGIT_NAUGHTY_LIST_EXPIRATION_HOURS =
toString cfg.naughtyListExpirationHours;
NGIT_ARCHIVE_ALL = toString cfg.archiveAll;
NGIT_ARCHIVE_ALL = if cfg.archiveAll then "true" else "false";
NGIT_ARCHIVE_WHITELIST = concatStringsSep "," cfg.archiveWhitelist;
NGIT_REPOSITORY_WHITELIST = concatStringsSep "," cfg.repositoryWhitelist;
NGIT_REPOSITORY_BLACKLIST = concatStringsSep "," cfg.repositoryBlacklist;
@@ -299,7 +299,7 @@ let
} // optionalAttrs (cfg.relayName != null) {
NGIT_RELAY_NAME = cfg.relayName;
} // optionalAttrs (cfg.archiveReadOnly != null) {
NGIT_ARCHIVE_READ_ONLY = toString cfg.archiveReadOnly;
NGIT_ARCHIVE_READ_ONLY = if cfg.archiveReadOnly then "true" else "false";
} // optionalAttrs cfg.metricsEnabled { NGIT_METRICS_ENABLED = "true"; }
// optionalAttrs (cfg.syncBootstrapRelayUrl != null) {
NGIT_SYNC_BOOTSTRAP_RELAY_URL = cfg.syncBootstrapRelayUrl;