Unverified Commit 64c77755 authored by Jon Seager's avatar Jon Seager Committed by GitHub
Browse files

homepage-dashboard: add unixtools.ping to PATH (#442572)

parents 069253cc 74411c6c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -19693,6 +19693,12 @@
    githubId = 821972;
    name = "Parth Mehrotra";
  };
  parthiv-krishna = {
    email = "nixpkgs@parthiv.cc";
    github = "parthiv-krishna";
    githubId = 20658472;
    name = "Parthiv Krishna";
  };
  pascalj = {
    email = "nix@pascalj.de";
    github = "pascalj";
+18 −1
Original line number Diff line number Diff line
{ lib, ... }:
{
  name = "homepage-dashboard";
  meta.maintainers = with lib.maintainers; [ ];
  meta.maintainers = with lib.maintainers; [ parthiv-krishna ];

  nodes.machine = _: {
    services.homepage-dashboard = {
@@ -21,10 +21,23 @@
          ];
        }
      ];
      services = [
        {
          Machines = [
            {
              Localhost = {
                ping = "127.0.0.1";
              };
            }
          ];
        }
      ];
    };
  };

  testScript = ''
    import json

    # Ensure the services are started on managed machine
    machine.wait_for_unit("homepage-dashboard.service")
    machine.wait_for_open_port(8082)
@@ -40,5 +53,9 @@
    # Ensure that we see the custom bookmarks on the page
    page = machine.succeed("curl --fail http://127.0.0.1:8082/api/bookmarks")
    assert "nixpkgs" in page, "Custom bookmarks not found"

    # Ensure that the ping command works
    response = machine.succeed("curl --fail \"http://localhost:8082/api/ping?groupName=Machines&serviceName=Localhost\"")
    assert json.loads(response)["alive"] is True, "Ping to localhost failed"
  '';
}
+4 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  pnpm_10,
  python3,
  stdenv,
  unixtools,
  cctools,
  lib,
  nixosTests,
@@ -89,7 +90,8 @@ stdenv.mkDerivation (finalAttrs: {
      --set-default PORT 3000 \
      --set-default HOMEPAGE_CONFIG_DIR /var/lib/homepage-dashboard \
      --set-default NIXPKGS_HOMEPAGE_CACHE_DIR /var/cache/homepage-dashboard \
      --add-flags "$out/share/homepage/server.js"
      --add-flags "$out/share/homepage/server.js" \
      --set PATH "${lib.makeBinPath [ unixtools.ping ]}"

    ${if enableLocalIcons then installLocalIcons else ""}

@@ -111,7 +113,7 @@ stdenv.mkDerivation (finalAttrs: {
    mainProgram = "homepage";
    homepage = "https://gethomepage.dev";
    license = lib.licenses.gpl3;
    maintainers = with lib.maintainers; [ ];
    maintainers = with lib.maintainers; [ parthiv-krishna ];
    platforms = lib.platforms.all;
  };
})