2021-11-02 22:51:27 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bzip2
|
|
|
|
, coreutils
|
|
|
|
, gnutar
|
|
|
|
, gzip
|
|
|
|
, makeWrapper
|
|
|
|
, nix
|
|
|
|
}:
|
2017-04-26 07:53:40 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nix-bundle";
|
2021-11-02 20:10:56 +00:00
|
|
|
version = "0.4.1";
|
2017-04-26 07:53:40 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matthewbauer";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-11-02 20:10:56 +00:00
|
|
|
sha256 = "0js8spwjvw6kjxz1i072scd035fhiyazixvn84ibdnw8dx087gjv";
|
2017-04-26 07:53:40 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2021-11-02 22:51:27 +00:00
|
|
|
# coreutils, gnutar are needed by nix for bootstrap
|
|
|
|
buildInputs = [
|
|
|
|
bzip2
|
|
|
|
coreutils
|
|
|
|
gnutar
|
|
|
|
gzip
|
|
|
|
nix
|
|
|
|
];
|
2017-04-26 07:53:40 +01:00
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper $out/share/nix-bundle/nix-bundle.sh $out/bin/nix-bundle \
|
2021-11-02 22:51:27 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath buildInputs}
|
|
|
|
ln -s $out/share/nix-bundle/nix-run.sh $out/bin/nix-run
|
2017-04-26 07:53:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-11-02 22:51:27 +00:00
|
|
|
homepage = "https://github.com/matthewbauer/nix-bundle";
|
2017-04-26 07:53:40 +01:00
|
|
|
description = "Create bundles from Nixpkgs attributes";
|
2021-11-02 22:51:27 +00:00
|
|
|
longDescription = ''
|
|
|
|
nix-bundle is a way to package Nix attributes into single-file
|
|
|
|
executables.
|
|
|
|
|
|
|
|
Benefits:
|
|
|
|
- Single-file output
|
|
|
|
- Can be run by non-root users
|
|
|
|
- No runtime
|
|
|
|
- Distro agnostic
|
|
|
|
- No installation
|
|
|
|
'';
|
2017-04-26 07:53:40 +01:00
|
|
|
license = licenses.mit;
|
2021-11-02 22:51:27 +00:00
|
|
|
maintainers = [ maintainers.matthewbauer ];
|
|
|
|
platforms = platforms.all;
|
2017-04-26 07:53:40 +01:00
|
|
|
};
|
|
|
|
}
|