Is there a standard no-op / dummy / do-nothing package in Nixpkgs? I’ve been using
no-op = derivation {
name = "no-op";
system = builtins.currentSystem
builder = "/bin/sh";
args = [ "-c" "echo > $out" ];
};
(I have a few miscellaneous questions tangentially related to this.)
- Is there an easy way to make an empty folder instead of a empty file without pulling in any additional dependencies? I tried using
mkdir
but it’s not available.
nix-repl> :b derivation { name = "no-op"; system = builtins.currentSystem; builder = "/bin/sh"; args = ["-c" "mkdir $out"]; }
error: builder for '/nix/store/k9ap5rjkyhan49f220w4c7vqmj2lq0rs-no-op.drv' failed with exit code 127;
last 1 log lines:
> sh: mkdir: not found
For full logs, run 'nix-store -l /nix/store/k9ap5rjkyhan49f220w4c7vqmj2lq0rs-no-op.drv'.
[0 built (1 failed)]
- What is
/bin/sh
in the build sandbox? I thought it was pkgs.busybox-sandbox-shell (see this issue and this commit) but that shell does seem to havemkdir
.
nix run nixpkgs#busybox-sandbox-shell "sh"
BusyBox v1.36.1 () built-in shell (ash)
$ mkdir
mkdir: missing operand
Try 'mkdir --help' for more information.