services: paperless: setup reverse proxy
This commit is contained in:
parent
df3cffadaf
commit
95733f9e05
|
@ -120,6 +120,11 @@ in
|
|||
enable = true;
|
||||
};
|
||||
|
||||
paperless = {
|
||||
enable = true;
|
||||
port = 8085;
|
||||
};
|
||||
|
||||
postgresql-backup = {
|
||||
enable = true;
|
||||
};
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
./nextcloud.nix
|
||||
./nginx.nix
|
||||
./nuage.nix
|
||||
./paperless.nix
|
||||
./pipewire.nix
|
||||
./postgresql-backup.nix
|
||||
./postgresql.nix
|
||||
|
|
35
services/paperless.nix
Normal file
35
services/paperless.nix
Normal file
|
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue