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
paperless: add package and service #44086
Conversation
a64d1e1
to
0e2ebd9
Compare
Python packages should be globally available. Nowadays each package gets one directory/file. One commit per package would be nice but it may be ok to put them all in one. Have you thought about creating a matching NixOS module? |
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.
Please create the packages besides paperless itself inside the pythonPackages
package set. Some of them might already be packaged.
0e2ebd9
to
416155a
Compare
Back from vacation, please excuse the delay! @dotlambda, done. @jfrankenau, I've added a service module, but there are a few open issues:
I'm using this script for testing the service. |
@erikarvstedt, I guess for now using Django is OK.
What about adding another |
|
||
consumptionDir = mkOption { | ||
type = with types; nullOr str; | ||
default = null; |
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.
Set it to the default value mentioned in the description and remove the if-clause below.
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.
Good catch! Fixed.
416155a
to
960d8c9
Compare
The migration has to run in a preStart script so that the server, which is only active when the consumer is active, is disabled during migrations. A dedicated paperless user would be no more 'real' than the nobody user. |
Adding a new user is as you say for isolation purposes. Especially as |
Ok, done. |
f9f6874
to
07373c2
Compare
pkgs/top-level/python-packages.nix
Outdated
@@ -284,7 +284,9 @@ in { | |||
|
|||
fire = callPackage ../development/python-modules/fire { }; | |||
|
|||
globus-sdk = callPackage ../development/python-modules/globus-sdk { }; |
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.
You apparently accidentally deleted this line which causes the CI to fail during evaluation:
https://gist.github.com/GrahamcOfBorg/14241c580774a606e627f780e1809db9
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.
Done. Thanks for digging into this, I thought that error came from upstream.
07373c2
to
d3cb6f7
Compare
d3cb6f7
to
6d212ea
Compare
90298fd
to
78bb5bc
Compare
78bb5bc: Rebased to |
@dotlambda Do you feel this is suitable? Don't think it's fair to @erikarvstedt to leave this unmerged any longer. |
I can understand if the review and maintanence burden of this feature seems unreasonable to you. I'd be fine with moving it to NUR then. |
Oh no, I think this is perfectly suitable to have in nixpkgs. |
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.
Only some really minor stuff. And yes, this should definitely be merged.
django_2_0 = pyPkgs: pyPkgs.django_2_1.overrideDerivation (_: rec { | ||
pname = "Django"; | ||
version = "2.0.12"; | ||
name = "${pname}-${version}"; |
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.
name = "${pname}-${version}"; |
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.
For overrideDerivation
, we have to update name
manually.
set -e | ||
${setupEnv} | ||
${extraCmds} | ||
exec python $paperlessSrc/manage.py "$@" |
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.
exec python $paperlessSrc/manage.py "$@" | |
exec ${paperless.python.interpreter} $paperlessSrc/manage.py "$@" |
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.
The correct form would be paperless.pythonEnv.interpreter
.
setupEnv
already handles all these details, so I'd rather not repeat them to keep it DRY.
b5651b3: Rebased to master
|
@erikarvstedt If you can rebase/squash this I can merge this. |
Thank you @erikarvstedt for your patience (also very organized summary of changes which helps with reviews) and of course your contributions ✨ Likewise thanks to our reviewers 👍 |
The attribute name is the attribute in the package set, and not the |
Huge thanks for your help and feedback, @dotlambda, @worldofpeace! @FRidh, you meant to post that in another thread, right? |
Notes for reviewers
Paperless has no setup.py, the main way to use it is to call
manage.py
in a properly setupPython environment. That's what
${paperless}/bin/paperless
does.Paperless requires some Python packages that are missing from
nixpkgs
. Currently, they are defined inextra-python-packages.nix
. Should I add them all topython-packages.nix
? Do we need an extra git commit for each package?Here's a sample script for testing:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)