diff --git a/pkgs/applications/blockchains/go-ethereum.nix b/pkgs/applications/blockchains/go-ethereum.nix index 776253ac9cdd..dd3904b27cb8 100644 --- a/pkgs/applications/blockchains/go-ethereum.nix +++ b/pkgs/applications/blockchains/go-ethereum.nix @@ -1,6 +1,12 @@ { lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit }: -buildGoModule rec { +let + # A list of binaries to put into separate outputs + bins = [ + "geth" + ]; + +in buildGoModule rec { pname = "go-ethereum"; version = "1.9.25"; @@ -16,6 +22,13 @@ buildGoModule rec { doCheck = false; + outputs = [ "out" ] ++ bins; + + # Move binaries to separate outputs and symlink them back to $out + postInstall = lib.concatStringsSep "\n" ( + builtins.map (bin: "mkdir -p \$${bin}/bin && mv $out/bin/${bin} \$${bin}/bin/ && ln -s \$${bin}/bin/${bin} $out/bin/") bins + ); + subPackages = [ "cmd/abidump" "cmd/abigen" @@ -40,7 +53,7 @@ buildGoModule rec { meta = with lib; { homepage = "https://geth.ethereum.org/"; description = "Official golang implementation of the Ethereum protocol"; - license = with licenses; [ lgpl3 gpl3 ]; + license = with licenses; [ lgpl3Plus gpl3Plus ]; maintainers = with maintainers; [ adisbladis lionello xrelkd RaghavSood ]; }; }