Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, haskellPackages, fetchFromGitHub }: 2 3stdenv.mkDerivation { 4 pname = "nix-script"; 5 version = "2020-03-23"; 6 7 src = fetchFromGitHub { 8 owner = "bennofs"; 9 repo = "nix-script"; 10 rev = "7706b45429ff22c35bab575734feb2926bf8840b"; 11 sha256 = "0yiqljamcj9x8z801bwj7r30sskrwv4rm6sdf39j83jqql1fyq7y"; 12 }; 13 14 strictDeps = true; 15 nativeBuildInputs = [ 16 (haskellPackages.ghcWithPackages (hs: with hs; [ posix-escape ])) 17 ]; 18 19 buildPhase = '' 20 runHook preBuild 21 22 mkdir -p $out/bin 23 ghc -O2 $src/nix-script.hs -o $out/bin/nix-script -odir . -hidir . 24 25 runHook postBuild 26 ''; 27 installPhase = '' 28 runHook preInstall 29 30 ln -s $out/bin/nix-script $out/bin/nix-scripti 31 32 runHook postInstall 33 ''; 34 35 meta = with lib; { 36 description = "A shebang for running inside nix-shell"; 37 homepage = "https://github.com/bennofs/nix-script"; 38 license = licenses.bsd3; 39 maintainers = with maintainers; [ bennofs rnhmjoj ]; 40 platforms = haskellPackages.ghc.meta.platforms; 41 }; 42}