goss: ensure bash, getent and systemd are in the PATH

This will fix the failing `command` rule of `goss`
which requires the sh binary and use a hardcoded path upstream.

Changed files
+18 -2
pkgs
tools
misc
+18 -2
pkgs/tools/misc/goss/default.nix
···
-
{ buildGoModule
+
{ bash
+
, buildGoModule
, fetchFromGitHub
+
, getent
, goss
-
, nix-update-script
, lib
+
, makeWrapper
+
, nix-update-script
+
, nixosTests
+
, stdenv
+
, systemd
, testers
}:
···
"-s" "-w" "-X main.version=v${version}"
];
+
nativeBuildInputs = [ makeWrapper ];
+
checkFlags = [
# Prometheus tests are skipped upstream
# See https://github.com/goss-org/goss/blob/master/ci/go-test.sh
"-skip" "^TestPrometheus"
];
+
+
postInstall = let
+
runtimeDependencies = [ bash getent ]
+
++ lib.optionals stdenv.isLinux [ systemd ];
+
in ''
+
wrapProgram $out/bin/goss \
+
--prefix PATH : "${lib.makeBinPath runtimeDependencies}"
+
'';
passthru = {
tests.version = testers.testVersion {