From 7d6f0bd007c4d2ea7819cd4df2d453ec8dade281 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Mon, 4 Mar 2024 19:05:30 +0100 Subject: [PATCH] add paperless.nix --- nixos/components/network/tinc/private.nix | 1 + nixos/machines/chungus/configuration.nix | 2 ++ nixos/machines/chungus/paperless.nix | 15 +++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 nixos/machines/chungus/paperless.nix diff --git a/nixos/components/network/tinc/private.nix b/nixos/components/network/tinc/private.nix index 4da6955..8d34a62 100644 --- a/nixos/components/network/tinc/private.nix +++ b/nixos/components/network/tinc/private.nix @@ -47,6 +47,7 @@ let "tdarr.chungus" = hosts.chungus; "trilium.chungus" = hosts.chungus; "tts.chungus" = hosts.chungus; + "paperless.chungus" = hosts.chungus; # cream "trilium.cream" = hosts.cream; }; diff --git a/nixos/machines/chungus/configuration.nix b/nixos/machines/chungus/configuration.nix index fede3e1..0a7ceac 100644 --- a/nixos/machines/chungus/configuration.nix +++ b/nixos/machines/chungus/configuration.nix @@ -62,6 +62,8 @@ ./docker-registry.nix + ./paperless.nix + ]; components.gui.enable = false; diff --git a/nixos/machines/chungus/paperless.nix b/nixos/machines/chungus/paperless.nix new file mode 100644 index 0000000..acda414 --- /dev/null +++ b/nixos/machines/chungus/paperless.nix @@ -0,0 +1,15 @@ +{ config, ... }: { + services.paperless = { + enable = true; + }; + services.nginx.virtualHosts."paperless.${config.networking.hostName}.private" = { + extraConfig = '' + allow ${config.tinc.private.subnet}; + deny all; + ''; + locations."/" = { + proxyPass = "http://localhost:${toString config.services.paperless.port}"; + proxyWebsockets = true; + }; + }; +}