diff --git a/hosts/poseidon/default.nix b/hosts/poseidon/default.nix index 487f79f..059126c 100644 --- a/hosts/poseidon/default.nix +++ b/hosts/poseidon/default.nix @@ -120,6 +120,11 @@ in enable = true; }; + paperless = { + enable = true; + port = 8085; + }; + postgresql-backup = { enable = true; }; diff --git a/services/default.nix b/services/default.nix index 2ccf820..1761fc1 100644 --- a/services/default.nix +++ b/services/default.nix @@ -15,6 +15,7 @@ ./nextcloud.nix ./nginx.nix ./nuage.nix + ./paperless.nix ./pipewire.nix ./postgresql-backup.nix ./postgresql.nix diff --git a/services/paperless.nix b/services/paperless.nix new file mode 100644 index 0000000..a315251 --- /dev/null +++ b/services/paperless.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.my.services.paperless; + my = config.my; + domain = config.networking.domain; +in +{ + options.my.services.paperless = { + enable = lib.mkEnableOption "Paperless"; + + port = mkOption { + type = types.port; + default = 8080; + example = 8080; + description = "Internal port for Paperless service"; + }; + }; + + config = mkIf cfg.enable { + services.nginx.virtualHosts = { + "paperless.${domain}" = { + forceSSL = true; + enableACME = true; + + locations."/" = { + proxyPass = "http://127.0.0.1:${toString cfg.port}"; + proxyWebsockets = true; + }; + }; + }; + }; +}