depot/third_party/nixpkgs/pkgs/tools/package-management/nix-bundle/default.nix
Default email 75ca762b89 Project import generated by Copybara.
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
2021-03-09 11:18:52 +08:00

37 lines
1 KiB
Nix

{ stdenv, lib, fetchFromGitHub, nix, makeWrapper, coreutils, gnutar, gzip, bzip2 }:
stdenv.mkDerivation rec {
pname = "nix-bundle";
version = "0.4.0";
src = fetchFromGitHub {
owner = "matthewbauer";
repo = pname;
rev = "v${version}";
sha256 = "0hdvdjm467w37clkhbifn54hbdmnxlbk66cj88lwaz26j4s2ik5g";
};
nativeBuildInputs = [ makeWrapper ];
# coreutils, gnutar is actually needed by nix for bootstrap
buildInputs = [ nix coreutils gnutar gzip bzip2 ];
binPath = lib.makeBinPath [ nix coreutils gnutar gzip bzip2 ];
makeFlags = [ "PREFIX=$(out)" ];
postInstall = ''
mkdir -p $out/bin
makeWrapper $out/share/nix-bundle/nix-bundle.sh $out/bin/nix-bundle \
--prefix PATH : ${binPath}
cp $out/share/nix-bundle/nix-run.sh $out/bin/nix-run
'';
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";
};
}