From 4febb87d2a00fdcc684917b9908d3bfc96fa8bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 8 Feb 2023 00:31:55 +0100 Subject: [PATCH] Use latest paperless version --- modules/paperless/default.nix | 36 +++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/modules/paperless/default.nix b/modules/paperless/default.nix index f95dc12..6ab20f4 100644 --- a/modules/paperless/default.nix +++ b/modules/paperless/default.nix @@ -2,6 +2,7 @@ lib, config, pkgs, + masterModulesPath, ... }: with lib; let @@ -9,6 +10,14 @@ with lib; let cfg = config.pub-solar.paperless; xdg = config.home-manager.users."${psCfg.user.name}".xdg; in { + imports = [ + "${masterModulesPath}/services/misc/paperless.nix" + ]; + + disabledModules = [ + "services/misc/paperless.nix" + ]; + options.pub-solar.paperless = { enable = mkEnableOption "All you need to go paperless"; ocrLanguage = mkOption { @@ -17,23 +26,33 @@ in { example = "eng+deu"; default = "eng"; }; + + dataDir = mkOption { + description = "Directory to save data in"; + type = types.str; + example = "/home/pub_solar/Paperless"; + default = "/home/${psCfg.user.name}/Paperless"; + }; + consumptionDir = mkOption { description = "Directory to be watched"; type = types.str; example = "/var/lib/paperless/consume"; - default = "/home/${psCfg.user.name}/Documents"; + default = "/var/lib/paperless/consume"; }; + scannerDefaultDevice = mkOption { - description = '' The scanner device. To find this, use `scanimage -L`. + description = '' + The scanner device. To find this, use `scanimage -L`. - For example, your output might be the following: + For example, your output might be the following: - ``` - device `v4l:/dev/video3' is a Noname Logitech StreamCam virtual device - device `hp3900:libusb:005:002' is a Hewlett-Packard Scanjet G3010 flatbed scanner - ``` + ``` + device `v4l:/dev/video3' is a Noname Logitech StreamCam virtual device + device `hp3900:libusb:005:002' is a Hewlett-Packard Scanjet G3010 flatbed scanner + ``` - Here, the scannerDevice is `hp3900:libusb:005:002`. + Here, the scannerDevice is `hp3900:libusb:005:002`. ''; type = types.str; }; @@ -44,6 +63,7 @@ in { enable = true; user = psCfg.user.name; consumptionDir = cfg.consumptionDir; + dataDir = cfg.dataDir; address = "paperless.local"; extraConfig = { PAPERLESS_OCR_LANGUAGE = cfg.ocrLanguage;