From d57c48cd2c62154f76eca9ee91fba70197724199 Mon Sep 17 00:00:00 2001 From: Alice Jacka Date: Mon, 19 Jan 2026 11:35:00 +1100 Subject: [PATCH] nixos/homepage-dashboard: Allow multiple environmentFiles Systemd supports passing a list to serviceConfig.EnvironmentFile to use multiple environment files, this is useful to have a separate secret file for each services listed on homepage, instead of one monolithic file. --- .../manual/release-notes/rl-2605.section.md | 2 ++ .../services/misc/homepage-dashboard.nix | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2605.section.md b/nixos/doc/manual/release-notes/rl-2605.section.md index fa13d6c7c4f6..b9007bab7112 100644 --- a/nixos/doc/manual/release-notes/rl-2605.section.md +++ b/nixos/doc/manual/release-notes/rl-2605.section.md @@ -97,6 +97,8 @@ of pulling the upstream container image from Docker Hub. If you want the old beh - `services.angrr` now uses TOML for configuration. Define policies with `services.angrr.settings` (generate TOML file) or point to a file using `services.angrr.configFile`. The legacy options `services.angrr.period`, `services.angrr.ownedOnly`, and `services.angrr.removeRoot` have been removed. See `man 5 angrr` and the description of `services.angrr.settings` options for examples and details. +- `services.homepage-dashboard.environmentFile` has been renamed to `services.homepage-dashboard.environmentFiles`, and now expects a list of strings. + - `services.pingvin-share` has been removed as the `pingvin-share.backend` package was broken and the project was archived upstream. ## Other Notable Changes {#sec-release-26.05-notable-changes} diff --git a/nixos/modules/services/misc/homepage-dashboard.nix b/nixos/modules/services/misc/homepage-dashboard.nix index c344d1b4a44c..e74bfdca3c53 100644 --- a/nixos/modules/services/misc/homepage-dashboard.nix +++ b/nixos/modules/services/misc/homepage-dashboard.nix @@ -10,6 +10,14 @@ let settingsFormat = pkgs.formats.yaml { }; in { + imports = [ + (lib.mkChangedOptionModule + [ "services" "homepage-dashboard" "environmentFile" ] + [ "services" "homepage-dashboard" "environmentFiles" ] + (config: [ config.services.homepage-dashboard.environmentFile ]) + ) + ]; + options = { services.homepage-dashboard = { enable = lib.mkEnableOption "Homepage Dashboard, a highly customizable application dashboard"; @@ -41,10 +49,10 @@ in ''; }; - environmentFile = lib.mkOption { - type = lib.types.str; + environmentFiles = lib.mkOption { + type = lib.types.listOf lib.types.path; description = '' - The path to an environment file that contains environment variables to pass + A list of paths to environment files that contain environment variables to pass to the homepage-dashboard service, for the purpose of passing secrets to the service. @@ -52,7 +60,7 @@ in ''; - default = ""; + default = [ ]; }; customCSS = lib.mkOption { @@ -243,7 +251,7 @@ in serviceConfig = { Type = "simple"; - EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile; + EnvironmentFile = cfg.environmentFiles; StateDirectory = "homepage-dashboard"; CacheDirectory = "homepage-dashboard"; ExecStart = lib.getExe cfg.package;