git.iko.soy/typeable/nixpkgs
on master help sign in
paperless: remove package & module as it has been superseded by paperless-ng

The paperless project has moved on to paperless-ng and the original paperless package in Nixpkgs has stopped working recently (due to version incompatibility with the providede Django package). Instead of investing more time into the old module we should migrate all users to the new module instead.

commit6e1421013a299668fd610dd70b3ebd9105891b90 authorAndreas Rammhold <andreas@rammhold.de> dateThu 3 Jun 2021, 15:59 (5 years ago) parent95f2dc6
14 files changed+140−543
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+84 nixos/doc/manual/release-notes/rl-2111.section.md+47 nixos/modules/module-list.nix−1 nixos/modules/services/misc/paperless-ng.nix+8−8 nixos/modules/services/misc/paperless.nix−183 nixos/tests/all-tests.nix−1 nixos/tests/paperless.nix−36 pkgs/applications/office/paperless/default.nix−168 pkgs/applications/office/paperless/python-modules/default.nix−11 pkgs/applications/office/paperless/python-modules/django-crispy-forms.nix−39 pkgs/applications/office/paperless/python-modules/django-filter.nix−26 pkgs/applications/office/paperless/withConfig.nix−68 pkgs/top-level/aliases.nix+1 pkgs/top-level/all-packages.nix−2
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+84
@@ -176,6 +176,90 @@
176176 <section xml:id="sec-release-21.11-incompatibilities">
177177 <title>Backward Incompatibilities</title>
178178 <itemizedlist>
179+ <listitem>
180+ <para>
181+ The <literal>paperless</literal> module and package have been
182+ removed. All users should migrate to the successor
183+ <literal>paperless-ng</literal> instead. The Paperless project
184+ <link xlink:href="https://github.com/the-paperless-project/paperless/commit/9b0063c9731f7c5f65b1852cb8caff97f5e40ba4">has
185+ been archived</link> and advises all users to use
186+ <literal>paperless-ng</literal> instead.
187+ </para>
188+ <para>
189+ Users can use the <literal>services.paperless-ng</literal>
190+ module as a replacement while noting the following
191+ incompatibilities:
192+ </para>
193+ <itemizedlist spacing="compact">
194+ <listitem>
195+ <para>
196+ <literal>services.paperless.ocrLanguages</literal> has no
197+ replacement. Users should migrate to
198+ <link xlink:href="options.html#opt-services.paperless-ng.extraConfig"><literal>services.paperless-ng.extraConfig</literal></link>
199+ instead:
200+ </para>
201+ </listitem>
202+ </itemizedlist>
203+ <programlisting language="bash">
204+{
205+ services.paperless-ng.extraConfig = {
206+ # Provide languages as ISO 639-2 codes
207+ # separated by a plus (+) sign.
208+ # https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
209+ PAPERLESS_OCR_LANGUAGE = &quot;deu+eng+jpn&quot;; # German &amp; English &amp; Japanse
210+ };
211+}
212+</programlisting>
213+ <itemizedlist>
214+ <listitem>
215+ <para>
216+ If you previously specified
217+ <literal>PAPERLESS_CONSUME_MAIL_*</literal> settings in
218+ <literal>services.paperless.extraConfig</literal> you
219+ should remove those options now. You now
220+ <emphasis>must</emphasis> define those settings in the
221+ admin interface of paperless-ng.
222+ </para>
223+ </listitem>
224+ <listitem>
225+ <para>
226+ Option <literal>services.paperless.manage</literal> no
227+ longer exists. Use the script at
228+ <literal>${services.paperless-ng.dataDir}/paperless-ng-manage</literal>
229+ instead. Note that this script only exists after the
230+ <literal>paperless-ng</literal> service has been started
231+ at least once.
232+ </para>
233+ </listitem>
234+ <listitem>
235+ <para>
236+ After switching to the new system configuration you should
237+ run the Django management command to reindex your
238+ documents and optionally create a user, if you don’t have
239+ one already.
240+ </para>
241+ <para>
242+ To do so, enter the data directory (the value of
243+ <literal>services.paperless-ng.dataDir</literal>,
244+ <literal>/var/lib/paperless</literal> by default), switch
245+ to the paperless user and execute the management command
246+ like below:
247+ </para>
248+ <programlisting>
249+$ cd /var/lib/paperless
250+$ su paperless -s /bin/sh
251+$ ./paperless-ng-manage document_index reindex
252+# if not already done create a user account, paperless-ng requires a login
253+$ ./paperless-ng-manage createsuperuser
254+Username (leave blank to use 'paperless'): my-user-name
255+Email address: me@example.com
256+Password: **********
257+Password (again): **********
258+Superuser created successfully.
259+</programlisting>
260+ </listitem>
261+ </itemizedlist>
262+ </listitem>
179263 <listitem>
180264 <para>
181265 The <literal>staticjinja</literal> package has been upgraded
nixos/doc/manual/release-notes/rl-2111.section.md+47
@@ -55,6 +55,53 @@ pt-services.clipcat.enable).
5555
5656## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
5757
58+- The `paperless` module and package have been removed. All users should migrate to the
59+ successor `paperless-ng` instead. The Paperless project [has been
60+ archived](https://github.com/the-paperless-project/paperless/commit/9b0063c9731f7c5f65b1852cb8caff97f5e40ba4)
61+ and advises all users to use `paperless-ng` instead.
62+
63+ Users can use the `services.paperless-ng` module as a replacement while noting the following incompatibilities:
64+ - `services.paperless.ocrLanguages` has no replacement. Users should migrate to [`services.paperless-ng.extraConfig`](options.html#opt-services.paperless-ng.extraConfig) instead:
65+ ```nix
66+ {
67+ services.paperless-ng.extraConfig = {
68+ # Provide languages as ISO 639-2 codes
69+ # separated by a plus (+) sign.
70+ # https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
71+ PAPERLESS_OCR_LANGUAGE = "deu+eng+jpn"; # German & English & Japanse
72+ };
73+ }
74+ ```
75+
76+ - If you previously specified `PAPERLESS_CONSUME_MAIL_*` settings in
77+ `services.paperless.extraConfig` you should remove those options now. You
78+ now *must* define those settings in the admin interface of paperless-ng.
79+
80+ - Option `services.paperless.manage` no longer exists.
81+ Use the script at `${services.paperless-ng.dataDir}/paperless-ng-manage` instead.
82+ Note that this script only exists after the `paperless-ng` service has been
83+ started at least once.
84+
85+ - After switching to the new system configuration you should run the Django
86+ management command to reindex your documents and optionally create a user,
87+ if you don't have one already.
88+
89+ To do so, enter the data directory (the value of
90+ `services.paperless-ng.dataDir`, `/var/lib/paperless` by default), switch
91+ to the paperless user and execute the management command like below:
92+ ```
93+ $ cd /var/lib/paperless
94+ $ su paperless -s /bin/sh
95+ $ ./paperless-ng-manage document_index reindex
96+ # if not already done create a user account, paperless-ng requires a login
97+ $ ./paperless-ng-manage createsuperuser
98+ Username (leave blank to use 'paperless'): my-user-name
99+ Email address: me@example.com
100+ Password: **********
101+ Password (again): **********
102+ Superuser created successfully.
103+ ```
104+
58105- The `staticjinja` package has been upgraded from 1.0.4 to 3.0.1
59106
60107- The `erigon` ethereum node has moved to a new database format in `2021-05-04`, and requires a full resync
nixos/modules/module-list.nix−1
@@ -550,7 +550,6 @@
550550 ./services/misc/ombi.nix
551551 ./services/misc/osrm.nix
552552 ./services/misc/packagekit.nix
553− ./services/misc/paperless.nix
554553 ./services/misc/paperless-ng.nix
555554 ./services/misc/parsoid.nix
556555 ./services/misc/plex.nix
nixos/modules/services/misc/paperless-ng.nix+8−8
@@ -73,6 +73,14 @@ in
7373{
7474 meta.maintainers = with maintainers; [ earvstedt Flakebi ];
7575
76+ imports = [
77+ (mkRemovedOptionModule [ "services" "paperless"] ''
78+ The paperless module has been removed as the upstream project died.
79+ Users should migrate to the paperless-ng module (services.paperless-ng).
80+ More information can be found in the NixOS 21.11 release notes.
81+ '')
82+ ];
83+
7684 options.services.paperless-ng = {
7785 enable = mkOption {
7886 type = lib.types.bool;
@@ -180,14 +188,6 @@ in
180188 };
181189
182190 config = mkIf cfg.enable {
183− assertions = [
184− {
185− assertion = config.services.paperless.enable ->
186− (config.services.paperless.dataDir != cfg.dataDir && config.services.paperless.port != cfg.port);
187− message = "Paperless-ng replaces Paperless, either disable Paperless or assign a new dataDir and port to one of them";
188− }
189− ];
190−
191191 # Enable redis if no special url is set
192192 services.redis.enable = mkIf (!hasAttr "PAPERLESS_REDIS" env) true;
193193
nixos/modules/services/misc/paperless.nixdeleted−183
@@ -1,183 +0,0 @@
1−{ config, pkgs, lib, ... }:
2−
3−with lib;
4−let
5− cfg = config.services.paperless;
6−
7− defaultUser = "paperless";
8−
9− manage = cfg.package.withConfig {
10− config = {
11− PAPERLESS_CONSUMPTION_DIR = cfg.consumptionDir;
12− PAPERLESS_INLINE_DOC = "true";
13− PAPERLESS_DISABLE_LOGIN = "true";
14− } // cfg.extraConfig;
15− inherit (cfg) dataDir ocrLanguages;
16− paperlessPkg = cfg.package;
17− };
18−in
19−{
20− options.services.paperless = {
21− enable = mkOption {
22− type = lib.types.bool;
23− default = false;
24− description = ''
25− Enable Paperless.
26−
27− When started, the Paperless database is automatically created if it doesn't
28− exist and updated if the Paperless package has changed.
29− Both tasks are achieved by running a Django migration.
30− '';
31− };
32−
33− dataDir = mkOption {
34− type = types.str;
35− default = "/var/lib/paperless";
36− description = "Directory to store the Paperless data.";
37− };
38−
39− consumptionDir = mkOption {
40− type = types.str;
41− default = "${cfg.dataDir}/consume";
42− defaultText = "\${dataDir}/consume";
43− description = "Directory from which new documents are imported.";
44− };
45−
46− consumptionDirIsPublic = mkOption {
47− type = types.bool;
48− default = false;
49− description = "Whether all users can write to the consumption dir.";
50− };
51−
52− ocrLanguages = mkOption {
53− type = with types; nullOr (listOf str);
54− default = null;
55− description = ''
56− Languages available for OCR via Tesseract, specified as
57− <literal>ISO 639-2/T</literal> language codes.
58− If unset, defaults to all available languages.
59− '';
60− example = [ "eng" "spa" "jpn" ];
61− };
62−
63− address = mkOption {
64− type = types.str;
65− default = "localhost";
66− description = "Server listening address.";
67− };
68−
69− port = mkOption {
70− type = types.port;
71− default = 28981;
72− description = "Server port to listen on.";
73− };
74−
75− extraConfig = mkOption {
76− type = types.attrs;
77− default = {};
78− description = ''
79− Extra paperless config options.
80−
81− The config values are evaluated as double-quoted Bash string literals.
82−
83− See <literal>paperless-src/paperless.conf.example</literal> for available options.
84−
85− To enable user authentication, set <literal>PAPERLESS_DISABLE_LOGIN = "false"</literal>
86− and run the shell command <literal>$dataDir/paperless-manage createsuperuser</literal>.
87−
88− To define secret options without storing them in /nix/store, use the following pattern:
89− <literal>PAPERLESS_PASSPHRASE = "$(&lt; /etc/my_passphrase_file)"</literal>
90− '';
91− example = literalExample ''
92− {
93− PAPERLESS_OCR_LANGUAGE = "deu";
94− }
95− '';
96− };
97−
98− user = mkOption {
99− type = types.str;
100− default = defaultUser;
101− description = "User under which Paperless runs.";
102− };
103−
104− package = mkOption {
105− type = types.package;
106− default = pkgs.paperless;
107− defaultText = "pkgs.paperless";
108− description = "The Paperless package to use.";
109− };
110−
111− manage = mkOption {
112− type = types.package;
113− readOnly = true;
114− default = manage;
115− description = ''
116− A script to manage the Paperless instance.
117− It wraps Django's manage.py and is also available at
118− <literal>$dataDir/manage-paperless</literal>
119− '';
120− };
121− };
122−
123− config = mkIf cfg.enable {
124−
125− systemd.tmpfiles.rules = [
126− "d '${cfg.dataDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
127− ] ++ (optional cfg.consumptionDirIsPublic
128− "d '${cfg.consumptionDir}' 777 - - - -"
129− # If the consumption dir is not created here, it's automatically created by
130− # 'manage' with the default permissions.
131− );
132−
133− systemd.services.paperless-consumer = {
134− description = "Paperless document consumer";
135− serviceConfig = {
136− User = cfg.user;
137− ExecStart = "${manage} document_consumer";
138− Restart = "always";
139− };
140− after = [ "systemd-tmpfiles-setup.service" ];
141− wantedBy = [ "multi-user.target" ];
142− preStart = ''
143− if [[ $(readlink ${cfg.dataDir}/paperless-manage) != ${manage} ]]; then
144− ln -sf ${manage} ${cfg.dataDir}/paperless-manage
145− fi
146−
147− ${manage.setupEnv}
148− # Auto-migrate on first run or if the package has changed
149− versionFile="$PAPERLESS_DBDIR/src-version"
150− if [[ $(cat "$versionFile" 2>/dev/null) != ${cfg.package} ]]; then
151− python $paperlessSrc/manage.py migrate
152− echo ${cfg.package} > "$versionFile"
153− fi
154− '';
155− };
156−
157− systemd.services.paperless-server = {
158− description = "Paperless document server";
159− serviceConfig = {
160− User = cfg.user;
161− ExecStart = "${manage} runserver --noreload ${cfg.address}:${toString cfg.port}";
162− Restart = "always";
163− };
164− # Bind to `paperless-consumer` so that the server never runs
165− # during migrations
166− bindsTo = [ "paperless-consumer.service" ];
167− after = [ "paperless-consumer.service" ];
168− wantedBy = [ "multi-user.target" ];
169− };
170−
171− users = optionalAttrs (cfg.user == defaultUser) {
172− users.${defaultUser} = {
173− group = defaultUser;
174− uid = config.ids.uids.paperless;
175− home = cfg.dataDir;
176− };
177−
178− groups.${defaultUser} = {
179− gid = config.ids.gids.paperless;
180− };
181− };
182− };
183−}
nixos/tests/all-tests.nix−1
@@ -334,7 +334,6 @@ in
334334 pam-oath-login = handleTest ./pam-oath-login.nix {};
335335 pam-u2f = handleTest ./pam-u2f.nix {};
336336 pantheon = handleTest ./pantheon.nix {};
337− paperless = handleTest ./paperless.nix {};
338337 paperless-ng = handleTest ./paperless-ng.nix {};
339338 pdns-recursor = handleTest ./pdns-recursor.nix {};
340339 peerflix = handleTest ./peerflix.nix {};
nixos/tests/paperless.nixdeleted−36
@@ -1,36 +0,0 @@
1−import ./make-test-python.nix ({ lib, ... } : {
2− name = "paperless";
3− meta = with lib.maintainers; {
4− maintainers = [ earvstedt ];
5− };
6−
7− machine = { pkgs, ... }: {
8− environment.systemPackages = with pkgs; [ imagemagick jq ];
9− services.paperless = {
10− enable = true;
11− ocrLanguages = [ "eng" ];
12− };
13− };
14−
15− testScript = ''
16− machine.wait_for_unit("paperless-consumer.service")
17−
18− # Create test doc
19− machine.succeed(
20− "convert -size 400x40 xc:white -font 'DejaVu-Sans' -pointsize 20 -fill black -annotate +5+20 'hello world 16-10-2005' /var/lib/paperless/consume/doc.png"
21− )
22−
23− with subtest("Service gets ready"):
24− machine.wait_for_unit("paperless-server.service")
25− # Wait until server accepts connections
26− machine.wait_until_succeeds("curl -fs localhost:28981")
27−
28− with subtest("Test document is consumed"):
29− machine.wait_until_succeeds(
30− "(($(curl -fs localhost:28981/api/documents/ | jq .count) == 1))"
31− )
32− assert "2005-10-16" in machine.succeed(
33− "curl -fs localhost:28981/api/documents/ | jq '.results | .[0] | .created'"
34− )
35− '';
36−})
pkgs/applications/office/paperless/default.nixdeleted−168
@@ -1,168 +0,0 @@
1−{ stdenv
2−, lib
3−, fetchFromGitHub
4−, makeWrapper
5−, callPackage
6−
7−, python3
8−, imagemagick
9−, ghostscript
10−, optipng
11−, tesseract
12−, unpaper
13−}:
14−
15−## Usage
16−
17−# ${paperless}/bin/paperless wraps manage.py
18−
19−# ${paperless}/share/paperless/setup-env.sh can be sourced from a
20−# shell script to setup a Paperless environment
21−
22−# paperless.withConfig is a convenience function to setup a
23−# configured Paperless instance. (See ./withConfig.nix)
24−
25−# For WSGI with gunicorn, use a shell script like this:
26−# let
27−# pythonEnv = paperless.python.withPackages (ps: paperless.runtimePackages ++ [ ps.gunicorn ]);
28−# in
29−# writers.writeBash "run-gunicorn" ''
30−# source ${paperless}/share/paperless/setup-env.sh
31−# PYTHONPATH=$paperlessSrc ${pythonEnv}/bin/gunicorn paperless.wsgi
32−# ''
33−
34−let
35− paperless = stdenv.mkDerivation rec {
36− pname = "paperless";
37− version = "2.7.0";
38−
39− src = fetchFromGitHub {
40− owner = "the-paperless-project";
41− repo = "paperless";
42− rev = version;
43− sha256 = "0pkmyky1crjnsg7r0gfk0fadisfsgzlsq6afpz16wx4hp6yvkkf7";
44− };
45−
46− nativeBuildInputs = [ makeWrapper ];
47−
48− doCheck = true;
49− dontInstall = true;
50−
51− pythonEnv = python.withPackages (_: runtimePackages);
52− pythonCheckEnv = python.withPackages (_: (runtimePackages ++ checkPackages));
53−
54− unpackPhase = ''
55− srcDir=$out/share/paperless
56− mkdir -p $srcDir
57− cp -r --no-preserve=mode $src/src/* $src/LICENSE $srcDir
58− '';
59−
60− postPatch = ''
61− # django-cors-headers 3.x requires a scheme for allowed hosts
62− substituteInPlace $out/share/paperless/paperless/settings.py \
63− --replace "localhost:8080" "http://localhost:8080"
64− '';
65−
66− buildPhase = let
67− # Paperless has explicit runtime checks that expect these binaries to be in PATH
68− extraBin = lib.makeBinPath [ imagemagick ghostscript optipng tesseract unpaper ];
69− in ''
70− ${python.interpreter} -m compileall $srcDir
71−
72− makeWrapper $pythonEnv/bin/python $out/bin/paperless \
73− --set PATH ${extraBin} --add-flags $out/share/paperless/manage.py
74−
75− # A shell snippet that can be sourced to setup a paperless env
76− cat > $out/share/paperless/setup-env.sh <<EOF
77− export PATH="$pythonEnv/bin:${extraBin}''${PATH:+:}$PATH"
78− export paperlessSrc=$out/share/paperless
79− EOF
80− '';
81−
82− checkPhase = ''
83− source $out/share/paperless/setup-env.sh
84− tmpDir=$(realpath testsTmp)
85− mkdir $tmpDir
86− export HOME=$tmpDir
87− export PAPERLESS_MEDIADIR=$tmpDir
88− cd $paperlessSrc
89− # Prevent tests from writing to the derivation output
90− chmod -R -w $out
91− # Disable cache to silence a pytest warning ("could not create cache")
92− $pythonCheckEnv/bin/pytest -p no:cacheprovider
93− '';
94−
95− passthru = {
96− withConfig = callPackage ./withConfig.nix {};
97− inherit python runtimePackages checkPackages tesseract;
98− };
99−
100− meta = with lib; {
101− description = "Scan, index, and archive all of your paper documents";
102− homepage = "https://github.com/the-paperless-project/paperless";
103− license = licenses.gpl3;
104− maintainers = [ maintainers.earvstedt ];
105− };
106− };
107−
108− python = python3.override {
109− packageOverrides = self: super: let
110− customPkgs = import ./python-modules super fetchFromGitHub; in
111− {
112− pyocr = pyocrWithUserTesseract super;
113−
114− # Paperless is incompatible with factory_boy >= 3
115− factory_boy = customPkgs.factory_boy_2_12_0;
116−
117− # These are pre-release versions, hence they are private to this pkg
118− django-filter = self.callPackage ./python-modules/django-filter.nix {};
119− django-crispy-forms = self.callPackage ./python-modules/django-crispy-forms.nix {};
120− };
121− };
122−
123− runtimePackages = with python.pkgs; [
124− dateparser
125− python-dateutil
126− django
127− django-cors-headers
128− django-crispy-forms
129− django-filter
130− django_extensions
131− djangoql
132− djangorestframework
133− factory_boy
134− filemagic
135− fuzzywuzzy
136− langdetect
137− pdftotext
138− pillow
139− psycopg2
140− pyocr
141− python-dotenv
142− python-gnupg
143− pytz
144− termcolor
145− ] ++ (lib.optional stdenv.isLinux inotify-simple);
146−
147− checkPackages = with python.pkgs; [
148− pytest
149− pytest-django
150− pytest-env
151− pytest-xdist
152− ];
153−
154− pyocrWithUserTesseract = pyPkgs:
155− let
156− pyocr = pyPkgs.pyocr.override { inherit tesseract; };
157− in
158− if pyocr.outPath == pyPkgs.pyocr.outPath then
159− pyocr
160− else
161− # The user has provided a custom tesseract derivation that might be
162− # missing some languages that are required for PyOCR's tests. Disable them to
163− # avoid build errors.
164− pyocr.overridePythonAttrs (attrs: {
165− doCheck = false;
166− });
167−in
168− paperless
pkgs/applications/office/paperless/python-modules/default.nixdeleted−11
@@ -1,11 +0,0 @@
1−pyPkgs: fetchFromGitHub:
2−{
3− factory_boy_2_12_0 = pyPkgs.factory_boy.overridePythonAttrs (old: rec {
4− version = "2.12.0";
5− src = pyPkgs.fetchPypi {
6− inherit (old) pname;
7− inherit version;
8− sha256 = "0w53hjgag6ad5i2vmrys8ysk54agsqvgbjy9lg8g0d8pi9h8vx7s";
9− };
10− });
11−}
pkgs/applications/office/paperless/python-modules/django-crispy-forms.nixdeleted−39
@@ -1,39 +0,0 @@
1−{ lib
2−, buildPythonPackage
3−, fetchFromGitHub
4−, pytestCheckHook
5−, pytest-django
6−, django
7−}:
8−
9−buildPythonPackage rec {
10− pname = "django-crispy-forms";
11− version = "1.10.0";
12−
13− src = fetchFromGitHub {
14− owner = "django-crispy-forms";
15− repo = "django-crispy-forms";
16− rev = version;
17− sha256 = "0y6kskfxgckb9npcgwx4zrs5n9px159zh9zhinhxi3i7wlriqpf5";
18− };
19−
20− # For reasons unknown, the source dir must contain a dash
21− # for the tests to run successfully
22− postUnpack = ''
23− mv $sourceRoot source-
24− export sourceRoot=source-
25− '';
26−
27− checkInputs = [ django pytest-django pytestCheckHook ];
28−
29− preCheck = ''
30− export DJANGO_SETTINGS_MODULE=crispy_forms.tests.test_settings
31− '';
32−
33− meta = with lib; {
34− description = "The best way to have DRY Django forms";
35− homepage = "https://github.com/maraujop/django-crispy-forms";
36− license = licenses.mit;
37− maintainers = with maintainers; [ earvstedt ];
38− };
39−}
pkgs/applications/office/paperless/python-modules/django-filter.nixdeleted−26
@@ -1,26 +0,0 @@
1−{ lib, buildPythonPackage, python, pythonOlder, fetchFromGitHub
2−, django, django-crispy-forms, djangorestframework, mock, pytz }:
3−
4−buildPythonPackage rec {
5− pname = "django-filter";
6− version = "2.1.0-pre";
7− disabled = pythonOlder "3.4";
8−
9− src = fetchFromGitHub {
10− owner = "carltongibson";
11− repo = pname;
12− rev = "24adad8c48bc9e7c7539b6510ffde4ce4effdc29";
13− sha256 = "0hv4w95jnlzp9vdximl6bb27fyi75001jhvsbs0ikkd8amq8iaj7";
14− };
15−
16− checkInputs = [ django django-crispy-forms djangorestframework mock pytz ];
17−
18− checkPhase = "${python.interpreter} runtests.py";
19−
20− meta = with lib; {
21− description = "A reusable Django application for allowing users to filter querysets dynamically.";
22− homepage = "https://github.com/carltongibson/django-filter";
23− license = licenses.bsd3;
24− maintainers = with maintainers; [ earvstedt ];
25− };
26−}
pkgs/applications/office/paperless/withConfig.nixdeleted−68
@@ -1,68 +0,0 @@
1−{ paperless, lib, writers }:
2−
3−## Usage
4−#
5−# nix-build --out-link ./paperless -E '
6−# (import <nixpkgs> {}).paperless.withConfig {
7−# dataDir = /tmp/paperless-data;
8−# config = {
9−# PAPERLESS_DISABLE_LOGIN = "true";
10−# };
11−# }'
12−#
13−# Setup DB
14−# ./paperless migrate
15−#
16−# Consume documents in ${dataDir}/consume
17−# ./paperless document_consumer --oneshot
18−#
19−# Start web interface
20−# ./paperless runserver --noreload localhost:8000
21−
22−{ config ? {}, dataDir ? null, ocrLanguages ? null
23−, paperlessPkg ? paperless, extraCmds ? "" }:
24−with lib;
25−let
26− paperless = if ocrLanguages == null then
27− paperlessPkg
28− else
29− (paperlessPkg.override {
30− tesseract = paperlessPkg.tesseract.override {
31− enableLanguages = ocrLanguages;
32− };
33− }).overrideDerivation (_: {
34− # `ocrLanguages` might be missing some languages required by the tests.
35− doCheck = false;
36− });
37−
38− envVars = (optionalAttrs (dataDir != null) {
39− PAPERLESS_CONSUMPTION_DIR = "${dataDir}/consume";
40− PAPERLESS_MEDIADIR = "${dataDir}/media";
41− PAPERLESS_STATICDIR = "${dataDir}/static";
42− PAPERLESS_DBDIR = dataDir;
43− }) // config;
44−
45− envVarDefs = mapAttrsToList (n: v: ''export ${n}="${toString v}"'') envVars;
46− setupEnvVars = builtins.concatStringsSep "\n" envVarDefs;
47−
48− setupEnv = ''
49− source ${paperless}/share/paperless/setup-env.sh
50− ${setupEnvVars}
51− ${optionalString (dataDir != null) ''
52− mkdir -p "$PAPERLESS_CONSUMPTION_DIR" \
53− "$PAPERLESS_MEDIADIR" \
54− "$PAPERLESS_STATICDIR" \
55− "$PAPERLESS_DBDIR"
56− ''}
57− '';
58−
59− runPaperless = writers.writeBash "paperless" ''
60− set -e
61− ${setupEnv}
62− ${extraCmds}
63− exec python $paperlessSrc/manage.py "$@"
64− '';
65−in
66− runPaperless // {
67− inherit paperless setupEnv;
68− }
pkgs/top-level/aliases.nix+1
@@ -553,6 +553,7 @@ mapAliases ({
553553 owncloudclient = owncloud-client; # added 2016-08
554554 ocz-ssd-guru = throw "ocz-ssd-guru has been removed due to there being no source available"; # added 2021-07-12
555555 p11_kit = p11-kit; # added 2018-02-25
556+ paperless = paperless-ng; # added 2021-06-06
556557 parity = openethereum; # added 2020-08-01
557558 parquet-cpp = arrow-cpp; # added 2018-09-08
558559 pass-otp = pass.withExtensions (ext: [ext.pass-otp]); # added 2018-05-04
pkgs/top-level/all-packages.nix−2
@@ -7889,8 +7889,6 @@ with pkgs;
78897889
78907890 pamtester = callPackage ../tools/security/pamtester { };
78917891
7892− paperless = callPackage ../applications/office/paperless { };
7893−
78947892 paperless-ng = callPackage ../applications/office/paperless-ng { };
78957893
78967894 paperwork = callPackage ../applications/office/paperwork/paperwork-gtk.nix { };