# Canonical no-op / dummy package from Nixpkgs?

**URL:** https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806
**Category:** Help
**Created:** [December 24, 2024, 11:21am UTC](https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806 "2024-12-24T11:21:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vazae](https://discourse.nixos.org/user_avatar/discourse.nixos.org/vazae/32/9979_2.png) [@vazae](https://discourse.nixos.org/u/vazae)
#### Post date: [December 24, 2024, 11:21am UTC](https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806/1 "2024-12-24T11:21:35Z")

</div>

Is there a standard no-op / dummy / do-nothing package in Nixpkgs? I’ve been using

```nix
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.)

1. 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
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)]

```

1. What is `/bin/sh` in the build sandbox? I thought it was [pkgs.busybox-sandbox-shell](https://github.com/NixOS/nix/blob/f72752c0dc6547b1568a9ef46deba875e38fada2/packaging/dependencies.nix#L172-L194) (see [this issue](https://github.com/NixOS/nix/issues/6081) and [this commit](https://github.com/NixOS/nix/commit/a2d92bb20e82a0957067ede60e91fab256948b41)) but that shell _does_ seem to have `mkdir`.

```bash
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.

```

---

<div class="post-metadata">

### Author: ![azuwis](https://discourse.nixos.org/user_avatar/discourse.nixos.org/azuwis/32/5887_2.png) [@azuwis](https://discourse.nixos.org/u/azuwis)
#### Post date: [December 24, 2024, 1:02pm UTC](https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806/2 "2024-12-24T13:02:59Z")

</div>

The `mkdir` is from your `$PATH`, you can tell by running `which mkdir`.

Or

```auto
$ nix shell nixpkgs#busybox-sandbox-shell --command busybox mkdir
mkdir: applet not found

```

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [December 24, 2024, 1:22pm UTC](https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806/3 "2024-12-24T13:22:50Z")

</div>

> [@vazae](#):
>
> Is there an easy way to make an empty folder

`pkgs.emptyDirectory`

---

<div class="post-metadata">

### Author: ![Atemu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/atemu/32/10383_2.png) [@Atemu](https://discourse.nixos.org/u/Atemu)
#### Post date: [December 24, 2024, 1:56pm UTC](https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806/4 "2024-12-24T13:56:50Z")

</div>

Accordingly, there is also `pkgs.emptyFile`.

---

<div class="post-metadata">

### Author: ![vazae](https://discourse.nixos.org/user_avatar/discourse.nixos.org/vazae/32/9979_2.png) [@vazae](https://discourse.nixos.org/u/vazae)
#### Post date: [December 24, 2024, 2:30pm UTC](https://discourse.nixos.org/t/canonical-no-op-dummy-package-from-nixpkgs/57806/5 "2024-12-24T14:30:07Z")

</div>

Oops, you’re exactly right about the `$PATH` leakage.

Thanks all! Unfortunately Discourse only allows me to mark one answer as a solution, but thanks everyone for answering all three of my questions.
