From a048e58d5f9cad7445222d976be2926e11c40e2b Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Thu, 2 Oct 2025 17:04:51 -0500 Subject: [PATCH] add trilium --- hosts/h001/mods/default.nix | 1 + hosts/h001/mods/trilium.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 hosts/h001/mods/trilium.nix diff --git a/hosts/h001/mods/default.nix b/hosts/h001/mods/default.nix index 5408430..309625e 100644 --- a/hosts/h001/mods/default.nix +++ b/hosts/h001/mods/default.nix @@ -7,5 +7,6 @@ ./monitoring.nix ./pinchflat.nix ./openwebui.nix + ./trilium.nix ]; } diff --git a/hosts/h001/mods/trilium.nix b/hosts/h001/mods/trilium.nix new file mode 100644 index 0000000..10e4154 --- /dev/null +++ b/hosts/h001/mods/trilium.nix @@ -0,0 +1,35 @@ +{ lib, pkgs, config, ... }: +{ + config = { + services.trilium-server = { + enable = true; + port = 9111; + host = "127.0.0.1"; + dataDir = "/var/lib/trilium"; + # noAuthentication = true; # keep authentication for now + }; + + # systemd.tmpfiles.rules = [ + # "d /var/lib/trilium 0755 trilium trilium -" + # ]; + + services.nginx = { + virtualHosts = { + "trilium" = { + serverName = "h001.net.joshuabell.xyz"; + listen = [ + { + port = 9111; + addr = "0.0.0.0"; + } + ]; + locations."/" = { + proxyWebsockets = true; + recommendedProxySettings = true; + proxyPass = "http://127.0.0.1:9111"; + }; + }; + }; + }; + }; +}