1
0
Fork 0
mirror of https://github.com/NixOS/nix-pills synced 2024-09-19 04:00:13 -04:00
nix-pills/pills/20/two-hellos.nix

31 lines
621 B
Nix
Raw Normal View History

2018-02-23 17:27:25 -05:00
let
nixpkgs = import <nixpkgs> {};
2018-02-23 17:27:25 -05: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";
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