Commit d57c48cd authored by Alice Jacka's avatar Alice Jacka
Browse files

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.
parent 42c8ee3b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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}
+13 −5
Original line number Diff line number Diff line
@@ -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;