-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/paperless: use toShellVars for paperless-manage #242275
nixos/paperless: use toShellVars for paperless-manage #242275
Conversation
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.
e6928e8
to
44f637a
Compare
In #242084 is some discussion about the same issue. We have to decide which approach we want to use. |
The env of the |
The doc from the other PR is only necessary because it still doesn't quote shell vars correctly. toShellVars does. The hint about using toJSON would be a handy addition though. |
Ah, that's what @leona-ya meant. Yes, this should be included. Here's the version from my fixup. |
Oh yes, that's what I meant. I'm sorry that was imprecise |
Co-authored-by: Christian Theune <[email protected]> Co-authored-by: Erik Arvstedt <[email protected]>
Any further objections? |
@Atemu, tbh, I'd prefer to avoid manage = pkgs.writeShellScript "manage" ''
${lib.concatStringsSep "\n" (mapAttrsToList (name: val: "export ${name}=${escapeShellArg val}") env)}
exec ${pkg}/bin/paperless-ngx "$@"
''; This avoids:
Weak preference, so I'm fine with ACKing this PR as it is. |
We need the verdict of a senior Nixer. @mweinelt, can you help us out? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this merged.
Slight preference for easier to read code in this case. |
Successfully created backport PR for |
Thanks! |
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.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)