2017-04-28 21:14:49 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, nix, makeWrapper, coreutils, gnutar, gzip, bzip2 }:
|
2017-04-26 08:53:40 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nix-bundle";
|
|
|
|
name = "${pname}-${version}";
|
2017-10-13 19:23:19 +02:00
|
|
|
version = "0.2.0";
|
2017-04-26 08:53:40 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matthewbauer";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2017-10-13 19:23:19 +02:00
|
|
|
sha256 = "0klabmygbhzlwxja8p2w8fp8ip3xaa5ym9c15rp9qxzh03hfmdjx";
|
2017-04-26 08:53:40 +02:00
|
|
|
};
|
|
|
|
|
2017-04-28 21:14:49 +02:00
|
|
|
# coreutils, gnutar is actually needed by nix for bootstrap
|
|
|
|
buildInputs = [ nix coreutils makeWrapper gnutar gzip bzip2 ];
|
2017-04-26 08:53:40 +02:00
|
|
|
|
2017-04-28 21:14:49 +02:00
|
|
|
binPath = lib.makeBinPath [ nix coreutils gnutar gzip bzip2 ];
|
2017-04-26 08:53:40 +02:00
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper $out/share/nix-bundle/nix-bundle.sh $out/bin/nix-bundle \
|
|
|
|
--prefix PATH : ${binPath}
|
2017-10-13 19:23:19 +02:00
|
|
|
cp $out/share/nix-bundle/nix-run.sh $out/bin/nix-run
|
2017-04-26 08:53:40 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
maintainers = [ maintainers.matthewbauer ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
description = "Create bundles from Nixpkgs attributes";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = https://github.com/matthewbauer/nix-bundle;
|
|
|
|
};
|
|
|
|
}
|