about summary refs log tree commit diff
path: root/modules/services
diff options
context:
space:
mode:
Diffstat (limited to 'modules/services')
-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;
+    };
+  };
+}