Commit graph

83 commits

Author SHA1 Message Date
h7x4 39e93806aa
Revert "various: replace systemd.services.<name>.{script,preStart} with ExecStart{,Pre}" 2025-10-31 11:03:32 +01:00
h7x4 428fd47816
nixos/paperless: replace systemd script with ExecStart 2025-10-27 18:52:07 +09:00
Lukas Wurzinger 1f4c50ab81
lib/cli: deprecate toGNUCommandLine 2025-10-21 21:01:38 +02:00
Sandro Jäckel e97d6a77e1
nixos/paperless: add missing default to domain 2025-09-02 13:43:20 +02:00
Sandro b62d48b281
nixos/paperless: add configureNginx option (#385637) 2025-08-31 21:05:16 +02:00
Sandro Jäckel 53fb369dfa
nixos/paperless: update link 2025-08-26 17:19:38 +02:00
Sandro Jäckel 4de77741a5
nixos/paperless: add configureNginx option 2025-08-26 01:29:16 +02:00
Sandro Jäckel 06db824d91
paperless-ngx: 2.17.1 -> 2.18.1
Changelog: https://github.com/paperless-ngx/paperless-ngx/releases/tag/v2.18.0
Changelog: https://github.com/paperless-ngx/paperless-ngx/releases/tag/v2.18.1
2025-08-22 15:11:21 +02:00
Wolfgang Walther 5a0711127c
treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Wolfgang Walther 41c5662cbe
nixos/postgresql: move postStart into separate unit
This avoids restarting the postgresql server, when only ensureDatabases
or ensureUsers have been changed. It will also allow to properly wait
for recovery to finish later.

To wait for "postgresql is ready" in other services, we now provide a
postgresql.target.

Resolves #400018

Co-authored-by: Marcel <me@m4rc3l.de>
2025-06-24 15:26:47 +02:00
Sizhe Zhao 83f62fa58a
nixos/paperless: set GRANIAN_WORKERS_KILL_TIMEOUT 2025-05-21 23:51:03 +08:00
Jonas Sander 309871725f
nixos/paperless: expose manage package (#405610) 2025-05-19 16:37:40 +02:00
Martin Weinelt 71ec941833
nixos/services.paperless: add extra files OCR (#396946) 2025-05-03 19:18:41 +02:00
flakeuser 88e40e42ef nixos/services.paperless: add extra files OCR
This adds a setting for processing extra files with OCR through tika and
gotenberg
2025-05-03 09:39:50 -07:00
Sandro Jäckel bcb64d6806
paperless-ngx: 2.14.7 -> 2.15.1
Changelog: https://github.com/paperless-ngx/paperless-ngx/releases/tag/v2.15.0
Changelog: https://github.com/paperless-ngx/paperless-ngx/releases/tag/v2.15.1
2025-04-11 17:43:04 +02:00
Sandro Jäckel 7afa349ea8
nixos/paperless: mirror upstream admin user creation more closely
Closes #249767

Before we only created the admin user when passwordFile was set.
Now it is possible to set PAPERLESS_ADMIN_USER and
PAPERLESS_ADMIN_PASSWORD directly to create the admin user, like in the
upstream Docker image.
2025-04-04 17:22:31 +02:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Sandro Jäckel 36a3c6c11d
nixos/paperless: move paperless-manage to proper systemPackage 2025-02-27 21:47:35 +01:00
Sandro df5ec1a2e0
nixos/paperless: #242084 follow up to fix defaultText (#373472) 2025-01-25 21:10:25 +01:00
Gerd Flaig fe0b1ecf0a nixos/paperless: Support remote databases
When the database is on another host, unit isolation for the document
consumer and scheduler have to be disabled. This is currently enabled by
default via `PrivateNetwork = false` in defaultServiceConfig. Following
https://github.com/NixOS/nixpkgs/pull/368137#pullrequestreview-2522617890
making this conditional on the `database.createLocally` option.
2025-01-18 15:57:03 +01:00
Christian Theune 865ab91155 nixos/paperless: add module options for automated exports
Paperless includes a document exporter that can be used for e.g.
backups.

This change extends the module to provide a way to enable and configure
a timer, export settings, pre- and post-processing
scripts (e.g. to ship the backup somewhere else, clean up, ...).

It works out of the box when just enabling it but can be customized.

Includes suitable tests.
2025-01-06 08:26:23 +01:00
Sandro Jäckel b069f4f185
nixos/paperless: remove django-q workaround
This was long ago migrated to celery
https://github.com/paperless-ngx/paperless-ngx/pull/1648
2024-12-13 15:48:28 +01:00
Bruno BELANYI cf1f7c10f4 nixos/paperless: add 'database.createLocally' 2024-12-02 12:01:04 +00:00
Felix Buehler 9540ed8747 nixos/services.paperless: remove with lib; 2024-11-28 00:45:30 +01:00
Leona Maroni 1044b2ccdb
nixos/paperless: add environmentFile option (#350944) 2024-11-25 08:51:01 +01:00
Brendan Taylor d581c42d5d nixos/paperless: add secretsFile option 2024-11-10 08:21:07 -07:00
Franz Pletz 0fc41ad977
treewide: Remove ineffective capability grants. (#333533) 2024-11-06 08:12:51 +01:00
Sandro Jäckel c4a7c0fae5
nixos/paperless: fix shellcheck findings with enableStrictShellChecks enabled 2024-10-18 17:28:03 +02:00
Bjørn Forsman 48908e5b86 nixos: improve systemd slice names
Following
https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Description=,
update slice names to be short, descriptive and capitalized.
2024-10-02 20:24:13 +02:00
Pascal Bach b6c754755c nixos/paperless: fix documentation url
The original paperless project is archived

Co-authored-by: Antoine Martin <antoine97.martin@gmail.com>
2024-09-14 14:19:17 +02:00
Tomodachi94 b86ba024bd nixos/paperless: add system-paperless.slice
Non-breaking change.

Part of #279915.
2024-09-14 14:19:17 +02:00
Sandro Jäckel bb69775568
paperless-ngx: drop inactive maintainers, add myself to maintainers 2024-08-25 21:39:54 +02:00
Eduard Bachmakov cb10fe8aaf treewide: Remove ineffective capability grants.
Systemd units with `PrivateUsers` set get their capabilities within the user namespace only [1].
As a result they do cannot bind to privileged ports even though they *appear* like they should be able to.

The units in this commit [2] set `PrivateUsers` unconditionally so binding to privileged ports is currently impossible.
Granting them CAP_NET_BIND_SERVICE is useless and misleading any reader of those modules.
Technically, this commit also hardens these modules ever so slightly.

(There are corner cases where this could make sense (e.g. across units, using `JoinsNamspaceOf`) but this is arcane enough to not to be present in nixpkgs.)

[1]: systemd.exec(5): PrivateUsers
[2]: found using `rg -e 'PrivateUsers.?=\s+[^f][^a]' -l | xargs rg -e '\bCAP_' -l`
2024-08-09 23:10:30 +02:00
éclairevoyant 7d8742da87
treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00
e1mo f0721f3779
nixos/paperless: Always buidl tesseract with english
With the changes introduced in #303388 tesseract would only be compiled
with the languages defined in `PAPERLESS_OCR_LANGUAGE`. However, english
is always required, making tesseract fail to build when only non-english
languages are defined in tesseract:

```
eng.traineddata must be present in tessdata for Tesseract to work
```
2024-04-19 10:47:54 +02:00
Leona Maroni 025d3a2f65
Merge pull request #303388 from SuperSandro2000/paperless-only-enabled-languages
nixos/paperless: override enabled tesseract languages with the in paperless configured ones
2024-04-14 14:59:33 +02:00
Sandro Jäckel b579dac4ed
nixos/paperless: override enabled tesseract languages with the in paperless configured ones 2024-04-13 22:44:19 +02:00
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Casey Link 789684ad02
nixos/paperless: Switch to systemd.tmpfiles.settings
This option resolves #301746 by allowing the admin to bypass the
creation of the paperless directories by systemd-tmpfiles.

This is necessary when, for example, those directories lie inside an NFS
mount that the root user does not have rw access to.

Fixes #301746
2024-04-11 08:19:24 +02:00
Casey Link 9532793d59
nixos/paperless: refactor to use systemd LoadCredential
This replaces the paperless-copy-password service with the use of
systemd's LoadCredential mechanism.

It is not a breaking change since it is gated behind `cfg.passwordFile`.
2024-04-11 08:19:05 +02:00
Atemu 70fa188e17 nixos/paperless: set OMP_NUM_THREADS=1 by default
Fixes https://github.com/NixOS/nixpkgs/issues/240591
2024-03-26 17:56:01 +01:00
Sandro Jäckel da1ccb628f
nixos/paperless: fix too many open files
paperless-web-start[658743]: kombu.exceptions.OperationalError: [Errno 24] Too many open files: '/nix/store/k6h0pihpi3ih31zjk6ragqcp4mjz4pjs-python3.11-concurrent-log-handler-0.9.24/lib/python3.11/site-packages/concurrent_log_handler-0.9.24.dist-info/entry_points.txt'
2024-03-02 17:52:18 +01:00
Flakebi 9db96ee839
paperless: fix uploading files via local folder
The consumer service needs to be in the same namespace as the
task-queue, otherwise they cannot see each others temporary files.
Same as for web uploading.

See also the discussion here:
https://github.com/paperless-ngx/paperless-ngx/discussions/5606
2024-02-28 09:14:48 +01:00
Atemu f38bca1ca5
Merge pull request #279677 from leona-ya/paperless-nltk
nixos/paperless: use nltk_data package as NLTK data source
2024-02-01 16:59:28 +01:00
Leona Maroni 6300f478e9
nixos/paperless: use nltk_data package as NLTK data source
nixos
2024-02-01 16:53:34 +01:00
Luke Granger-Brown 23310f467a
Merge pull request #284980 from patka-123/update-paperless-service-example-doc
nixos/paperless: update extraConfig to settings in service docs.
2024-01-30 12:53:31 +00:00
Patka 3d028d17c9
nixos/paperless: update extraConfig to settings in service docs
Signed-off-by: Patka <patka@patka.dev>
2024-01-30 11:26:04 +01:00
Jade Lovelace 80edf319fe nixos/paperless: fix network-online.target dependencies 2024-01-18 16:28:41 -08:00
Sandro Jäckel 7c1b4b22f9
nixos/paperless: convert extraConfig to freeform type
Co-authored-by: Atemu <atemu.main@gmail.com>
2024-01-04 00:04:38 +01:00
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00