From 5f36f3ef6b530d6b5581623fce67b4342882a142 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 2 Nov 2025 13:03:47 +0100 Subject: [PATCH 1/2] nixos/actual: revert 452544: add environmentFile option This reverts commit c13f744cdf287c4c2d85422668be22d0e266436d. --- nixos/modules/services/web-apps/actual.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/nixos/modules/services/web-apps/actual.nix b/nixos/modules/services/web-apps/actual.nix index 1ece9f7f04f1..af15471521f1 100644 --- a/nixos/modules/services/web-apps/actual.nix +++ b/nixos/modules/services/web-apps/actual.nix @@ -32,16 +32,6 @@ in description = "Whether to open the firewall for the specified port."; }; - environmentFile = mkOption { - type = types.nullOr types.path; - default = null; - description = '' - Environment file for specifying additional settings such as secrets. - - See . - ''; - }; - settings = mkOption { default = { }; description = "Server settings, refer to [the documentation](https://actualbudget.org/docs/config/) for available options."; @@ -86,7 +76,6 @@ in Group = "actual"; StateDirectory = "actual"; WorkingDirectory = dataDir; - EnvironmentFile = cfg.environmentFile; LimitNOFILE = "1048576"; PrivateTmp = true; PrivateDevices = true; From 40171764ab012446c7e20611e4e5445a1c22cc63 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 2 Nov 2025 13:12:08 +0100 Subject: [PATCH 2/2] nixos/actual: allow specifying secretus using genJqSecretsReplacementSnippet --- nixos/modules/services/web-apps/actual.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/web-apps/actual.nix b/nixos/modules/services/web-apps/actual.nix index af15471521f1..0e0bd29c4236 100644 --- a/nixos/modules/services/web-apps/actual.nix +++ b/nixos/modules/services/web-apps/actual.nix @@ -2,6 +2,7 @@ lib, pkgs, config, + utils, ... }: let @@ -16,7 +17,6 @@ let ; cfg = config.services.actual; - configFile = formatType.generate "config.json" cfg.settings; dataDir = "/var/lib/actual"; formatType = pkgs.formats.json { }; @@ -34,7 +34,10 @@ in settings = mkOption { default = { }; - description = "Server settings, refer to [the documentation](https://actualbudget.org/docs/config/) for available options."; + description = '' + Server settings, refer to [the documentation](https://actualbudget.org/docs/config/) for available options. + You can specify secret values in this configuration by setting `somevalue._secret = "/path/to/file"` instead of setting `somevalue` directly. + ''; type = types.submodule { freeformType = formatType.type; @@ -68,13 +71,20 @@ in description = "Actual server, a local-first personal finance app"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - environment.ACTUAL_CONFIG_PATH = configFile; + environment.ACTUAL_CONFIG_PATH = "/run/actual/config.json"; + + preStart = '' + # Generate config including secret values. + ${utils.genJqSecretsReplacementSnippet cfg.settings "/run/actual/config.json"} + ''; + serviceConfig = { ExecStart = getExe cfg.package; DynamicUser = true; User = "actual"; Group = "actual"; StateDirectory = "actual"; + RuntimeDirectory = "actual"; WorkingDirectory = dataDir; LimitNOFILE = "1048576"; PrivateTmp = true;