Add a helper binary package utility
This commit is contained in:
parent
3c6e7fb246
commit
f9953c9f98
21
nix/lib/binary.nix
Normal file
21
nix/lib/binary.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{pkgs, patchElf ? false, name, url, sha256 ? "0000000000000000000000000000000000000000000000000000"}:
|
||||||
|
with pkgs;
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit name;
|
||||||
|
src = fetchurl {
|
||||||
|
url = url;
|
||||||
|
sha256 = sha256;
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
] ++ lib.optionals patchElf [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
phases = ["installPhase" "fixupPhase"];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp $src $out/bin/${name}
|
||||||
|
chmod u+x $out/bin/${name}
|
||||||
|
'';
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user