Commit 65f92138 authored by Gabe Venberg's avatar Gabe Venberg
Browse files

nixos/homepage-dashboard: Set ALLOWED_HOSTS env var.

homepage 1.0.0 requires this var to be set, this change allows setting
it without building an environmentFile.
parent 472b4108
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
  lib,
  ...
}:

let
  cfg = config.services.homepage-dashboard;
  # Define the settings format used for this program
@@ -29,6 +28,19 @@ in
        description = "Port for Homepage to bind to.";
      };

      allowedHosts = lib.mkOption {
        type = lib.types.str;
        default = "localhost:8082,127.0.0.1:8082";
        example = "example.com";
        description = ''
          Hosts that homepage-dashboard will be running under.
          You will want to change this in order to acess homepage from anything other than localhost.
          see the upsream documentation:

          <https://gethomepage.dev/installation/#homepage_allowed_hosts>
        '';
      };

      environmentFile = lib.mkOption {
        type = lib.types.str;
        description = ''
@@ -215,6 +227,7 @@ in
        NIXPKGS_HOMEPAGE_CACHE_DIR = "/var/cache/homepage-dashboard";
        PORT = toString cfg.listenPort;
        LOG_TARGETS = "stdout";
        HOMEPAGE_ALLOWED_HOSTS = cfg.allowedHosts;
      };

      serviceConfig = {