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.
This commit is contained in:
Alice Jacka 2026-01-19 11:35:00 +11:00
commit d57c48cd2c
2 changed files with 15 additions and 5 deletions

View file

@ -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}

View file

@ -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
<https://gethomepage.dev/installation/docker/#using-environment-secrets>
'';
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;