mirror of
https://github.com/bennofs/nix-script
synced 2025-01-09 20:34:20 +01:00
21 lines
749 B
Nix
21 lines
749 B
Nix
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
name = "nix-script";
|
|
src = ./nix-script.hs;
|
|
phases = [ "buildPhase" "installPhase" "fixupPhase" ];
|
|
buildPhase = ''mkdir -p $out/bin; ghc -O2 $src -o $out/bin/nix-script -odir $TMP'';
|
|
installPhase = ''
|
|
ln -s $out/bin/nix-script $out/bin/nix-scripti
|
|
ln -s $out/bin/nix-script $out/bin/nix-scripts
|
|
'';
|
|
buildInputs = [ (pkgs.haskellPackages.ghcWithPackages (hs: with hs; [posix-escape])) ];
|
|
meta = {
|
|
homepage = https://github.com/bennofs/nix-script;
|
|
description = "A shebang for running inside nix-shell.";
|
|
license = pkgs.lib.licenses.bsd3;
|
|
maintainers = [ pkgs.lib.maintainers.bennofs ];
|
|
platforms = pkgs.haskellPackages.ghc.meta.platforms;
|
|
};
|
|
}
|