From 391bda9e02f09dd18fcd81d5fbcb18e930b43744 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Mon, 3 Nov 2025 10:56:30 -0500 Subject: [PATCH] nixos/trilium-server: add option for environment file The server component of trilium allows for OAuth to be configured. Ideally secrets shouldn't be loaded in the nix store so this would allow for an environment file to be passed in via sops/agenix/ect --- nixos/modules/services/web-apps/trilium.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/services/web-apps/trilium.nix b/nixos/modules/services/web-apps/trilium.nix index 83f79589a947..566cb4d8390c 100644 --- a/nixos/modules/services/web-apps/trilium.nix +++ b/nixos/modules/services/web-apps/trilium.nix @@ -41,6 +41,16 @@ in ''; }; + environmentFile = mkOption { + type = types.nullOr types.path; + default = null; + example = "/secrets/trilium.env"; + description = '' + File to load as the environment file. This allows you to pass secrets in without writing + to the nix store. + ''; + }; + instanceName = mkOption { type = types.str; default = "Trilium"; @@ -126,6 +136,7 @@ in environment.TRILIUM_DATA_DIR = cfg.dataDir; serviceConfig = { ExecStart = lib.getExe cfg.package; + EnvironmentFile = cfg.environmentFile; User = "trilium"; Group = "trilium"; PrivateTmp = "true";