nixos/paperless: fix time.timeZone setting

This attribute set isn't passed through the NixOS config resolution
mechanism, which means that we can't use lib.mkDefault here.

Instead, just put it before any user overrides so that if the user
specifies this environment variable it'll just override it anyway.
This commit is contained in:
Luke Granger-Brown 2022-09-10 21:10:06 +01:00
parent accf3b38d5
commit 55d9a2c596

View file

@ -16,13 +16,13 @@ let
PAPERLESS_MEDIA_ROOT = cfg.mediaDir;
PAPERLESS_CONSUMPTION_DIR = cfg.consumptionDir;
GUNICORN_CMD_ARGS = "--bind=${cfg.address}:${toString cfg.port}";
} // (
lib.mapAttrs (_: toString) cfg.extraConfig
) // optionalAttrs (config.time.timeZone != null) {
PAPERLESS_TIME_ZONE = lib.mkDefault config.time.timeZone;
} // optionalAttrs (config.time.timeZone != null) {
PAPERLESS_TIME_ZONE = config.time.timeZone;
} // optionalAttrs enableRedis {
PAPERLESS_REDIS = "unix://${redisServer.unixSocket}";
};
} // (
lib.mapAttrs (_: toString) cfg.extraConfig
);
manage = let
setupEnv = lib.concatStringsSep "\n" (mapAttrsToList (name: val: "export ${name}=\"${val}\"") env);