feat(nix/binify): add binify
Create a store path where the executable `exe` is linked to $out/bin/${name}. This is useful for e.g. including it as a “package” in `buildInputs` of a shell.nix. For example, if I have the exeutable /nix/store/…-hello, I can make it into /nix/store/…-binify-hello/bin/hello with `binify { exe = …; name = "hello" }`. Change-Id: I600bdcd8f143bca2dd8dfbb165a9a5a8d6397622 Reviewed-on: https://cl.tvl.fyi/c/depot/+/624 Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
b6cb20b2d0
commit
17eba437a7
2 changed files with 17 additions and 0 deletions
16
nix/binify/default.nix
Normal file
16
nix/binify/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
# Create a store path where the executable `exe`
|
||||||
|
# is linked to $out/bin/${name}.
|
||||||
|
# This is useful for e.g. including it as a “package”
|
||||||
|
# in `buildInputs` of a shell.nix.
|
||||||
|
#
|
||||||
|
# For example, if I have the exeutable /nix/store/…-hello,
|
||||||
|
# I can make it into /nix/store/…-binify-hello/bin/hello
|
||||||
|
# with `binify { exe = …; name = "hello" }`.
|
||||||
|
{ exe, name }:
|
||||||
|
|
||||||
|
pkgs.runCommandLocal "binify-${name}" {} ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
ln -sT ${lib.escapeShellArg exe} $out/bin/${lib.escapeShellArg name}
|
||||||
|
''
|
1
third_party/default.nix
vendored
1
third_party/default.nix
vendored
|
@ -115,6 +115,7 @@ let
|
||||||
rsync
|
rsync
|
||||||
runCommand
|
runCommand
|
||||||
runCommandNoCC
|
runCommandNoCC
|
||||||
|
runCommandLocal
|
||||||
rustPlatform
|
rustPlatform
|
||||||
rustc
|
rustc
|
||||||
sbcl
|
sbcl
|
||||||
|
|
Loading…
Reference in a new issue