# What is the \`patchShebangs\` command in Nix build expressions?

**URL:** https://discourse.nixos.org/t/what-is-the-patchshebangs-command-in-nix-build-expressions/12656
**Category:** Help
**Created:** [April 24, 2021, 2:01am UTC](https://discourse.nixos.org/t/what-is-the-patchshebangs-command-in-nix-build-expressions/12656 "2021-04-24T02:01:55Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![jonringer](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jonringer/32/1348_2.png) [@jonringer](https://discourse.nixos.org/u/jonringer)
#### Post date: [April 24, 2021, 10:46pm UTC](https://discourse.nixos.org/t/what-is-the-patchshebangs-command-in-nix-build-expressions/12656/5 "2021-04-24T22:46:59Z")

</div>

> [@fricklerhandwerk](#):
>
> Can we have this as part of the manual on how nix builds work under the hood?

I believe this is what nix pills tries to achieve to a large extent. Nix has surprising little included in it. Most of what we think of “nixpkgs” is actually the “nixpkgs repository”, which is why the starting point of almost all nix expressions is `import <nixpkgs> {}`, `stdenv.mkDerivation`, or something similar. For example, `patchShebangs` command is only available during the build if you source the setuphook provided by the stdenv default builder (you get this by default when using `stdenv.mkDerivation`).

---

_[View the full topic](https://discourse.nixos.org/t/what-is-the-patchshebangs-command-in-nix-build-expressions/12656)._
