nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 bzip2,
6 coreutils,
7 gnutar,
8 gzip,
9 makeWrapper,
10 nix,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "nix-bundle";
15 version = "0.4.1";
16
17 src = fetchFromGitHub {
18 owner = "matthewbauer";
19 repo = "nix-bundle";
20 rev = "v${version}";
21 sha256 = "0js8spwjvw6kjxz1i072scd035fhiyazixvn84ibdnw8dx087gjv";
22 };
23
24 nativeBuildInputs = [ makeWrapper ];
25
26 # coreutils, gnutar are needed by nix for bootstrap
27 buildInputs = [
28 bzip2
29 coreutils
30 gnutar
31 gzip
32 nix
33 ];
34
35 makeFlags = [ "PREFIX=$(out)" ];
36
37 postInstall = ''
38 mkdir -p $out/bin
39 makeWrapper $out/share/nix-bundle/nix-bundle.sh $out/bin/nix-bundle \
40 --prefix PATH : ${lib.makeBinPath buildInputs}
41 ln -s $out/share/nix-bundle/nix-run.sh $out/bin/nix-run
42 '';
43
44 meta = {
45 homepage = "https://github.com/matthewbauer/nix-bundle";
46 description = "Create bundles from Nixpkgs attributes";
47 longDescription = ''
48 nix-bundle is a way to package Nix attributes into single-file
49 executables.
50
51 Benefits:
52 - Single-file output
53 - Can be run by non-root users
54 - No runtime
55 - Distro agnostic
56 - No installation
57 '';
58 license = lib.licenses.mit;
59 maintainers = [ ];
60 platforms = lib.platforms.all;
61 };
62}