aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/network/default.nix1
-rw-r--r--modules/storage/default.nix1
-rw-r--r--modules/storage/docs.nix15
-rw-r--r--modules/storage/syncthing.nix5
-rw-r--r--services/service-router.service.nix5
-rw-r--r--settings.nix7
6 files changed, 32 insertions, 2 deletions
diff --git a/modules/network/default.nix b/modules/network/default.nix
index f2dae8a..a601750 100644
--- a/modules/network/default.nix
+++ b/modules/network/default.nix
@@ -33,6 +33,7 @@ in
"photos.local" = { inherit host; port = ports.immich; };
"news.local" = { inherit host; port = ports.yarr; };
"librarian.local" = { inherit host; port = ports.lazylibrarian; };
+ "paperless.local" = { inherit host; port = ports.paperless; configureNginx = true; };
};
};
diff --git a/modules/storage/default.nix b/modules/storage/default.nix
index d4e8da9..f0c9af8 100644
--- a/modules/storage/default.nix
+++ b/modules/storage/default.nix
@@ -5,5 +5,6 @@
./immich.nix
./send.nix
./syncthing.nix
+ ./docs.nix
];
}
diff --git a/modules/storage/docs.nix b/modules/storage/docs.nix
new file mode 100644
index 0000000..7ea4fad
--- /dev/null
+++ b/modules/storage/docs.nix
@@ -0,0 +1,15 @@
+{ settings, lib, ... }:
+{
+ services.paperless = {
+ enable = true;
+ user = settings.paperless.user;
+ address = "0.0.0.0";
+ database.createLocally = true;
+ port = settings.network.ports.paperless;
+ consumptionDir = settings.paperless.docsDir;
+ consumptionDirIsPublic = true;
+ settings = {
+ PAPERLESS_URL = lib.mkForce "http://paperless.local";
+ };
+ };
+}
diff --git a/modules/storage/syncthing.nix b/modules/storage/syncthing.nix
index 982ee71..27db72b 100644
--- a/modules/storage/syncthing.nix
+++ b/modules/storage/syncthing.nix
@@ -32,6 +32,11 @@ in
path = settings.media.booksDir;
devices = lib.attrNames settings.syncthing.devices;
};
+ artemis-docs = {
+ label = "Documents";
+ path = settings.paperless.docsDir;
+ devices = lib.attrNames settings.syncthing.devices;
+ };
};
overrideDevices = false;
diff --git a/services/service-router.service.nix b/services/service-router.service.nix
index e52280f..0431e10 100644
--- a/services/service-router.service.nix
+++ b/services/service-router.service.nix
@@ -16,6 +16,7 @@ in {
protocol = mkOption { type = types.str; default = "http"; };
basePath = mkOption { type = types.str; default = ""; };
extraNginxOptions = mkOption { type = types.attrs; default = {}; };
+ configureNginx = mkOption { type = types.bool; default = true; };
}; });
default = {};
};
@@ -26,7 +27,7 @@ in {
enable = true;
recommendedOptimisation = true;
virtualHosts = lib.mapAttrs (_: val:
- let
+ lib.mkIf val.configureNginx (let
opts = if hasAttr "extraNginxOptions" val then val.extraNginxOptions else {};
in {
locations."/" = {
@@ -34,7 +35,7 @@ in {
"${val.protocol}://${val.host}:${toString val.port}${val.basePath}";
proxyWebsockets = true;
} // opts;
- }
+ })
) cfg.routes;
};
diff --git a/settings.nix b/settings.nix
index 5696874..741a6f3 100644
--- a/settings.nix
+++ b/settings.nix
@@ -22,6 +22,7 @@ in lib.recursiveUpdate privateSettings rec {
immich = 3144;
yarr = 7070;
lazylibrarian = 5299;
+ paperless = 28981;
};
exposeTransmissionRPC = false;
};
@@ -53,4 +54,10 @@ in lib.recursiveUpdate privateSettings rec {
group = "multimedia";
# booksGroup = "books";
};
+
+ paperless = rec {
+ docsDir = "/media/docs";
+ user = "paperless";
+ group = "paperless";
+ };
}