From dc6b9b09e032d07895c41741eb6238aac6398d1d Mon Sep 17 00:00:00 2001 From: notohh Date: Tue, 30 Jan 2024 18:57:07 -0500 Subject: [PATCH] yuki: init paperless-ngx --- hosts/yuki/hardware.nix | 5 +++++ hosts/yuki/services/default.nix | 1 + hosts/yuki/services/paperless.nix | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 hosts/yuki/services/paperless.nix diff --git a/hosts/yuki/hardware.nix b/hosts/yuki/hardware.nix index 0392dc3..57787d2 100644 --- a/hosts/yuki/hardware.nix +++ b/hosts/yuki/hardware.nix @@ -32,6 +32,11 @@ fsType = "nfs"; }; + fileSystems."/var/lib/paperless-ngx/media" = { + device = "192.168.1.199:/mnt/Sutoreji/paperless-ngx/paperless-media "; + fsType = "nfs"; + }; + swapDevices = [ {device = "/dev/disk/by-uuid/bd7ccb73-6f85-4b3d-b37f-5cff58a6ab59";} ]; diff --git a/hosts/yuki/services/default.nix b/hosts/yuki/services/default.nix index f5e6495..eefd836 100644 --- a/hosts/yuki/services/default.nix +++ b/hosts/yuki/services/default.nix @@ -9,5 +9,6 @@ ./homepage.nix ./searxng.nix ./anki-sync-server.nix + ./paperless.nix ]; } diff --git a/hosts/yuki/services/paperless.nix b/hosts/yuki/services/paperless.nix new file mode 100644 index 0000000..4950a45 --- /dev/null +++ b/hosts/yuki/services/paperless.nix @@ -0,0 +1,26 @@ +{ + pkgs, + config, + ... +}: { + sops.secrets.paperless-pwd = { + owner = "paperless"; + group = "paperless"; + }; + services.paperless = let + dataDir = "/var/lib/paperless-ngx"; + in { + package = pkgs.paperless-ngx; + enable = true; + address = "100.108.113.89"; + port = 28981; + passwordFile = config.sops.secrets.paperless-pwd.path; + dataDir = "${dataDir}"; + mediaDir = "${dataDir}/media"; + consumptionDir = "${dataDir}/consume"; + settings = { + PAPERLESS_ADMIN_USER = "notoh"; + PAPERLESS_REDIS = "redis://:paperless-ngx@100.94.214.100:6382"; + }; + }; +}