Skip to content

Instantly share code, notes, and snippets.

@johanot
Last active September 6, 2019 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanot/f8b19425f29ffb28611453ea2fcbd920 to your computer and use it in GitHub Desktop.
Save johanot/f8b19425f29ffb28611453ea2fcbd920 to your computer and use it in GitHub Desktop.
{
scriptDrvWithDeps = name: buildDeps: runtimeDeps: runCommand name { buildInputs = buildDeps ++ [makeWrapper]; } ''
mkdir -p $out/bin
cp ${../bin + "/${name}"} $out/bin/${name}
patchShebangs $out/bin/${name}
wrapProgram $out/bin/${name} \
--prefix PATH : "${lib.makeBinPath runtimeDeps}"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment