From fccddb3c6a17189b585c3f680b3bd1138a2f9c3e Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 10 Sep 2022 20:16:41 +0100 Subject: [PATCH] 3p/nixpkgs: fix paperless when timeZones are set --- .../nixos/modules/services/misc/paperless.nix | 6 +++--- .../paperless-no-you-cant-do-that.patch | 18 ++++++++++++++++++ third_party/nixpkgs/patches/series | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 third_party/nixpkgs/patches/paperless-no-you-cant-do-that.patch diff --git a/third_party/nixpkgs/nixos/modules/services/misc/paperless.nix b/third_party/nixpkgs/nixos/modules/services/misc/paperless.nix index 0a62af95f8..1fb222a165 100644 --- a/third_party/nixpkgs/nixos/modules/services/misc/paperless.nix +++ b/third_party/nixpkgs/nixos/modules/services/misc/paperless.nix @@ -16,11 +16,11 @@ let PAPERLESS_MEDIA_ROOT = cfg.mediaDir; PAPERLESS_CONSUMPTION_DIR = cfg.consumptionDir; GUNICORN_CMD_ARGS = "--bind=${cfg.address}:${toString cfg.port}"; + } // optionalAttrs (config.time.timeZone != null) { + PAPERLESS_TIME_ZONE = config.time.timeZone; } // ( lib.mapAttrs (_: toString) cfg.extraConfig - ) // optionalAttrs (config.time.timeZone != null) { - PAPERLESS_TIME_ZONE = lib.mkDefault config.time.timeZone; - } // optionalAttrs enableRedis { + ) // optionalAttrs enableRedis { PAPERLESS_REDIS = "unix://${redisServer.unixSocket}"; }; diff --git a/third_party/nixpkgs/patches/paperless-no-you-cant-do-that.patch b/third_party/nixpkgs/patches/paperless-no-you-cant-do-that.patch new file mode 100644 index 0000000000..fbf27cb769 --- /dev/null +++ b/third_party/nixpkgs/patches/paperless-no-you-cant-do-that.patch @@ -0,0 +1,18 @@ +diff --git a/nixos/modules/services/misc/paperless.nix b/nixos/modules/services/misc/paperless.nix +--- a/nixos/modules/services/misc/paperless.nix ++++ b/nixos/modules/services/misc/paperless.nix +@@ -16,11 +16,11 @@ let + PAPERLESS_MEDIA_ROOT = cfg.mediaDir; + PAPERLESS_CONSUMPTION_DIR = cfg.consumptionDir; + GUNICORN_CMD_ARGS = "--bind=${cfg.address}:${toString cfg.port}"; ++ } // optionalAttrs (config.time.timeZone != null) { ++ PAPERLESS_TIME_ZONE = config.time.timeZone; + } // ( + lib.mapAttrs (_: toString) cfg.extraConfig +- ) // optionalAttrs (config.time.timeZone != null) { +- PAPERLESS_TIME_ZONE = lib.mkDefault config.time.timeZone; +- } // optionalAttrs enableRedis { ++ ) // optionalAttrs enableRedis { + PAPERLESS_REDIS = "unix://${redisServer.unixSocket}"; + }; + diff --git a/third_party/nixpkgs/patches/series b/third_party/nixpkgs/patches/series index e69de29bb2..d487acc663 100644 --- a/third_party/nixpkgs/patches/series +++ b/third_party/nixpkgs/patches/series @@ -0,0 +1 @@ +paperless-no-you-cant-do-that.patch