nixos/paperless: use toShellVars for paperless-manage

The homebrewed snippet didn't escape vars properly which is an issue because
PAPERLESS_OCR_USER_ARGS requires a JSON string. This also meant a discrepancy
between the services' env vars and paperless-manage's.

Just use the correctly functioning library function for this instead.
This commit is contained in:
Atemu 2023-07-07 17:48:48 +02:00
parent 78419edadf
commit 44f637aa8d

View file

@ -26,14 +26,11 @@ let
lib.mapAttrs (_: toString) cfg.extraConfig lib.mapAttrs (_: toString) cfg.extraConfig
); );
manage = manage = pkgs.writeShellScript "manage" ''
let set -o allexport # Export the following env vars
setupEnv = lib.concatStringsSep "\n" (mapAttrsToList (name: val: "export ${name}=\"${val}\"") env); ${lib.toShellVars env}
in exec ${pkg}/bin/paperless-ngx "$@"
pkgs.writeShellScript "manage" '' '';
${setupEnv}
exec ${pkg}/bin/paperless-ngx "$@"
'';
# Secure the services # Secure the services
defaultServiceConfig = { defaultServiceConfig = {