diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 194494249268..098c69bf975b 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -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"; diff --git a/nixos/tests/homepage-dashboard.nix b/nixos/tests/homepage-dashboard.nix index 35165f650e9d..d72ebc215295 100644 --- a/nixos/tests/homepage-dashboard.nix +++ b/nixos/tests/homepage-dashboard.nix @@ -1,7 +1,7 @@ { 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" ''; } diff --git a/pkgs/by-name/ho/homepage-dashboard/package.nix b/pkgs/by-name/ho/homepage-dashboard/package.nix index 6428c52261d6..b5f753af768d 100644 --- a/pkgs/by-name/ho/homepage-dashboard/package.nix +++ b/pkgs/by-name/ho/homepage-dashboard/package.nix @@ -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; }; })