about summary refs log tree commit diff
path: root/modules/services/paperless.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-03-06 23:25:44 +0900
committersefidel <contact@sefidel.net>2024-03-06 23:25:44 +0900
commitdb84f186018971798951377fa95ed20dfc43e88a (patch)
treedfc38a97ce4df428c9c75052204ec0dedf1dd8e8 /modules/services/paperless.nix
parent784ed576aef48a5e06a532afd93e576c7673b25d (diff)
downloadnixrc-db84f186018971798951377fa95ed20dfc43e88a.tar.gz
nixrc-db84f186018971798951377fa95ed20dfc43e88a.zip
feat(modules): add paperless
Diffstat (limited to 'modules/services/paperless.nix')
-rw-r--r--modules/services/paperless.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/services/paperless.nix b/modules/services/paperless.nix
new file mode 100644
index 0000000..8b2d6f2
--- /dev/null
+++ b/modules/services/paperless.nix
@@ -0,0 +1,30 @@
+{ config, lib, ... }:
+
+with lib;
+let
+  cfg = config.modules.services.paperless;
+in
+{
+  options.modules.services.paperless = {
+    enable = mkEnableOption "paperless";
+
+    realHost = mkOption { type = types.str; };
+
+    secrets = {
+      paperless-superuser-password = mkOption { type = types.path; };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    services.paperless = rec {
+      enable = true;
+
+      port = 4007;
+
+      dataDir = "/smol/core/paperless";
+      mediaDir = "${dataDir}/media";
+
+      passwordFile = cfg.secrets.paperless-superuser-password;
+    };
+  };
+}