2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, haskellPackages, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "nix-script";
|
|
|
|
version = "2020-03-23";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bennofs";
|
|
|
|
repo = "nix-script";
|
|
|
|
rev = "7706b45429ff22c35bab575734feb2926bf8840b";
|
|
|
|
sha256 = "0yiqljamcj9x8z801bwj7r30sskrwv4rm6sdf39j83jqql1fyq7y";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
(haskellPackages.ghcWithPackages (hs: with hs; [ posix-escape ]))
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2021-07-21 07:28:18 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
ghc -O2 $src/nix-script.hs -o $out/bin/nix-script -odir . -hidir .
|
2021-07-21 07:28:18 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
2021-07-21 07:28:18 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
ln -s $out/bin/nix-script $out/bin/nix-scripti
|
2021-07-21 07:28:18 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "A shebang for running inside nix-shell";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/bennofs/nix-script";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ bennofs rnhmjoj ];
|
|
|
|
platforms = haskellPackages.ghc.meta.platforms;
|
|
|
|
};
|
|
|
|
}
|