From 2926b6e11f55dd7fcb9d45cb952be73d7750569f Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sun, 10 Feb 2019 23:08:58 +0100 Subject: [PATCH] nix-script: init at 2015-09-22 (#55495) --- pkgs/tools/nix/nix-script/default.nix | 34 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/tools/nix/nix-script/default.nix diff --git a/pkgs/tools/nix/nix-script/default.nix b/pkgs/tools/nix/nix-script/default.nix new file mode 100644 index 000000000000..3742d22c0212 --- /dev/null +++ b/pkgs/tools/nix/nix-script/default.nix @@ -0,0 +1,34 @@ +{ stdenv, haskellPackages, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "nix-script-${version}"; + version = "2015-09-22"; + + src = fetchFromGitHub { + owner = "bennofs"; + repo = "nix-script"; + rev = "83064dc557b642f6748d4f2372b2c88b2a82c4e7"; + sha256 = "0iwclyd2zz8lv012yghfr4696kdnsq6xvc91wv00jpwk2c09xl7a"; + }; + + buildInputs = [ + (haskellPackages.ghcWithPackages (hs: with hs; [ posix-escape ])) + ]; + + phases = [ "buildPhase" "installPhase" "fixupPhase" ]; + buildPhase = '' + mkdir -p $out/bin + ghc -O2 $src/nix-script.hs -o $out/bin/nix-script -odir . -hidir . + ''; + installPhase = '' + ln -s $out/bin/nix-script $out/bin/nix-scripti + ''; + + meta = with stdenv.lib; { + description = "A shebang for running inside nix-shell."; + homepage = https://github.com/bennofs/nix-script; + license = licenses.bsd3; + maintainers = with maintainers; [ bennofs rnhmjoj ]; + platforms = haskellPackages.ghc.meta.platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96bf2b70795d..98131dc032f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22713,6 +22713,8 @@ in nix-update-source = callPackage ../tools/package-management/nix-update-source {}; + nix-script = callPackage ../tools/nix/nix-script {}; + nix-template-rpm = callPackage ../build-support/templaterpm { inherit (pythonPackages) python toposort; }; nix-top = callPackage ../tools/package-management/nix-top { };