2018-02-23 17:27:25 -05:00
|
|
|
let
|
|
|
|
|
2018-04-12 07:38:14 -04:00
|
|
|
nixpkgs = import <nixpkgs> {};
|
2018-02-23 17:27:25 -05:00
|
|
|
|
2018-04-12 07:38:14 -04:00
|
|
|
inherit (nixpkgs) stdenv fetchurl which;
|
2018-02-23 17:27:25 -05:00
|
|
|
|
|
|
|
actualHello = stdenv.mkDerivation {
|
|
|
|
name = "hello-2.3";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = mirror://gnu/hello/hello-2.3.tar.bz2;
|
|
|
|
sha256 = "0c7vijq8y68bpr7g6dh1gny0bff8qq81vnp4ch8pjzvg56wb3js1";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
wrappedHello = stdenv.mkDerivation {
|
|
|
|
name = "hello-wrapper";
|
|
|
|
|
2018-04-12 07:38:14 -04:00
|
|
|
buildInputs = [ actualHello which ];
|
|
|
|
|
|
|
|
unpackPhase = "true";
|
2018-02-23 17:27:25 -05:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
echo "#! ${stdenv.shell}" >> "$out/bin/hello"
|
|
|
|
echo "exec $(which hello)" >> "$out/bin/hello"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in wrappedHello
|