diff --git a/pkgs/vouch/builder.nix b/pkgs/vouch/builder.nix new file mode 100644 index 00000000..2c6fa77b --- /dev/null +++ b/pkgs/vouch/builder.nix @@ -0,0 +1,35 @@ +{ + buildGoModule, + mcl, + bls, +}: { + version, + src, + vendorHash, + ... +} @ attrs: let + builder = buildGoModule ({ + # Needed otherwise deadnix removes the keys as a requirement for the + # function call + inherit version src vendorHash; + + pname = "vouch"; + + runVend = true; + + buildInputs = [mcl bls]; + + doCheck = false; + + meta = { + description = "An Ethereum 2 multi-node validator client"; + homepage = "https://github.com/attestantio/vouch"; + mainProgram = "vouch"; + platforms = ["x86_64-linux"]; + }; + + passthru.mkPackage = builder; + } + // attrs); +in + builder diff --git a/pkgs/vouch/default.nix b/pkgs/vouch/default.nix index cbbbefef..56e705ec 100644 --- a/pkgs/vouch/default.nix +++ b/pkgs/vouch/default.nix @@ -1,31 +1,20 @@ { - buildGoModule, + callPackage, fetchFromGitHub, mcl, bls, -}: -buildGoModule rec { - pname = "vouch"; - version = "1.7.6"; +}: let + mkVouch = callPackage ./builder.nix {inherit mcl bls;}; +in + mkVouch rec { + version = "1.7.6"; - src = fetchFromGitHub { - owner = "attestantio"; - repo = pname; - rev = "v${version}"; - hash = "sha256-zno/8uUkejS0zqOijGZdzknafavbvCU72uj/44on1f8="; - }; + src = fetchFromGitHub { + owner = "attestantio"; + repo = "vouch"; + rev = "v${version}"; + hash = "sha256-zno/8uUkejS0zqOijGZdzknafavbvCU72uj/44on1f8="; + }; - runVend = true; - vendorHash = "sha256-zNHLg/nIKvIbMZtyDANxEQ04dygFHxwrM3JJkD1zcjo="; - - buildInputs = [mcl bls]; - - doCheck = false; - - meta = { - description = "An Ethereum 2 multi-node validator client"; - homepage = "https://github.com/attestantio/vouch"; - mainProgram = "vouch"; - platforms = ["x86_64-linux"]; - }; -} + vendorHash = "sha256-zNHLg/nIKvIbMZtyDANxEQ04dygFHxwrM3JJkD1zcjo="; + } diff --git a/pkgs/vouch/unstable.nix b/pkgs/vouch/unstable.nix index b987b780..12b7954b 100644 --- a/pkgs/vouch/unstable.nix +++ b/pkgs/vouch/unstable.nix @@ -1,31 +1,20 @@ { - buildGoModule, + callPackage, fetchFromGitHub, mcl, bls, -}: -buildGoModule rec { - pname = "vouch"; - version = "1.8.0-beta.3"; +}: let + mkVouch = callPackage ./builder.nix {inherit mcl bls;}; +in + mkVouch rec { + version = "1.8.0-beta.3"; - src = fetchFromGitHub { - owner = "attestantio"; - repo = pname; - rev = "v${version}"; - hash = "sha256-CK6cLXJYMQL+ZRv8bYabgQ0GeDWK8Jcek6d/Wow2LI0="; - }; + src = fetchFromGitHub { + owner = "attestantio"; + repo = "vouch"; + rev = "v${version}"; + hash = "sha256-CK6cLXJYMQL+ZRv8bYabgQ0GeDWK8Jcek6d/Wow2LI0="; + }; - runVend = true; - vendorHash = "sha256-Mp+RA2L4mOe089ceyKh3m5Q8zLsdwyx6geMFrqbn5Dk="; - - buildInputs = [mcl bls]; - - doCheck = false; - - meta = { - description = "An Ethereum 2 multi-node validator client"; - homepage = "https://github.com/attestantio/vouch"; - mainProgram = "vouch"; - platforms = ["x86_64-linux"]; - }; -} + vendorHash = "sha256-Mp+RA2L4mOe089ceyKh3m5Q8zLsdwyx6geMFrqbn5Dk="; + }