2023-09-19 14:23:09 +00:00
|
|
|
|
{ bash
|
|
|
|
|
, buildGoModule
|
2023-09-04 10:32:09 +00:00
|
|
|
|
, fetchFromGitHub
|
2023-09-19 14:23:09 +00:00
|
|
|
|
, getent
|
2023-09-04 10:32:09 +00:00
|
|
|
|
, goss
|
|
|
|
|
, lib
|
2023-09-19 14:23:09 +00:00
|
|
|
|
, makeWrapper
|
|
|
|
|
, nix-update-script
|
|
|
|
|
, nixosTests
|
|
|
|
|
, stdenv
|
|
|
|
|
, systemd
|
2023-09-04 10:32:09 +00:00
|
|
|
|
, testers
|
|
|
|
|
}:
|
2021-05-02 17:53:38 +00:00
|
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
|
pname = "goss";
|
2024-05-29 08:17:28 +00:00
|
|
|
|
version = "0.4.7";
|
2021-05-02 17:53:38 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-09-04 10:27:46 +00:00
|
|
|
|
owner = "goss-org";
|
2021-05-02 17:53:38 +00:00
|
|
|
|
repo = pname;
|
2023-09-04 10:27:46 +00:00
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-29 08:17:28 +00:00
|
|
|
|
hash = "sha256-KP0i+ePmkx43MdokVQO3CvTsdIFO7rCWLd8vJVC9Qf0=";
|
2021-05-02 17:53:38 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-05-29 08:17:28 +00:00
|
|
|
|
vendorHash = "sha256-VLIDAlLO6COGDKDN12bYIBluFVgqPEmm8QRfSNPfLJY=";
|
2021-05-02 17:53:38 +00:00
|
|
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
2024-03-24 11:26:32 +00:00
|
|
|
|
|
2021-08-21 08:23:49 +00:00
|
|
|
|
ldflags = [
|
2024-03-24 11:26:32 +00:00
|
|
|
|
"-s"
|
|
|
|
|
"-w"
|
2024-05-29 08:17:28 +00:00
|
|
|
|
"-X github.com/goss-org/goss/util.Version=v${version}"
|
2021-08-21 08:23:49 +00:00
|
|
|
|
];
|
2021-05-02 17:53:38 +00:00
|
|
|
|
|
2023-09-19 14:23:09 +00:00
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
|
|
postInstall = let
|
|
|
|
|
runtimeDependencies = [ bash getent ]
|
|
|
|
|
++ lib.optionals stdenv.isLinux [ systemd ];
|
|
|
|
|
in ''
|
|
|
|
|
wrapProgram $out/bin/goss \
|
|
|
|
|
--prefix PATH : "${lib.makeBinPath runtimeDependencies}"
|
|
|
|
|
'';
|
|
|
|
|
|
2023-09-04 10:32:09 +00:00
|
|
|
|
passthru = {
|
2023-09-19 11:32:08 +00:00
|
|
|
|
tests = {
|
|
|
|
|
inherit (nixosTests) goss;
|
|
|
|
|
version = testers.testVersion {
|
|
|
|
|
command = "goss --version";
|
|
|
|
|
package = goss;
|
|
|
|
|
version = "v${version}";
|
|
|
|
|
};
|
2023-09-04 10:32:09 +00:00
|
|
|
|
};
|
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
|
};
|
|
|
|
|
|
2021-05-02 17:53:38 +00:00
|
|
|
|
meta = with lib; {
|
2023-09-04 10:27:46 +00:00
|
|
|
|
homepage = "https://github.com/goss-org/goss/";
|
|
|
|
|
changelog = "https://github.com/goss-org/goss/releases/tag/v${version}";
|
2021-05-02 17:53:38 +00:00
|
|
|
|
description = "Quick and easy server validation";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
Goss is a YAML based serverspec alternative tool for validating a server’s configuration.
|
|
|
|
|
It eases the process of writing tests by allowing the user to generate tests from the current system state.
|
|
|
|
|
Once the test suite is written they can be executed, waited-on, or served as a health endpoint.
|
|
|
|
|
'';
|
|
|
|
|
license = licenses.asl20;
|
2023-09-19 11:32:08 +00:00
|
|
|
|
mainProgram = "goss";
|
2023-09-04 10:28:46 +00:00
|
|
|
|
maintainers = with maintainers; [ hyzual jk anthonyroussel ];
|
2023-09-19 11:32:08 +00:00
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-05-02 17:53:38 +00:00
|
|
|
|
};
|
|
|
|
|
}
|