# Get size of /nix/store efficiently

**URL:** https://discourse.nixos.org/t/get-size-of-nix-store-efficiently/51354
**Category:** Nix
**Created:** [August 30, 2024, 10:12am UTC](https://discourse.nixos.org/t/get-size-of-nix-store-efficiently/51354 "2024-08-30T10:12:29Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![norpol](https://discourse.nixos.org/user_avatar/discourse.nixos.org/norpol/32/8764_2.png) [@norpol](https://discourse.nixos.org/u/norpol)
#### Post date: [January 28, 2026, 8:57pm UTC](https://discourse.nixos.org/t/get-size-of-nix-store-efficiently/51354/8 "2026-01-28T20:57:00Z")

</div>

> [@zwol](#):
>
> Bonus: all the other partitions can be mounted `nosuid`.

🙂 Hehe good news, in case you want to have that mount-flag on all filesystems.

`/nix/store` does not contain `suid` binaries, as nix build runs unprivileged, therefor can’t set `suid` - in addition it would cause security issues, such as when `eject` which is a `suid` binary contains a `suid`-exploiting CVE, you would have to remove the binary from your immutable store in order to fix the security issue.

Instead you have the option [`security.wrappers`](https://search.nixos.org/options?channel=25.11&show=security.wrappers&query=wrappers) which bundles all required binaries in a tmpfs under `/run/wrappers/bin` - which is populated by the [systemd service `suid-sgid-wrappers.service`](https://github.com/NixOS/nixpkgs/blob/1cd347bf3355fce6c64ab37d3967b4a2cb4b878c/nixos/modules/security/wrappers/default.nix#L305) which just stars a shell-script that runs basically `cp` + `chmod` from the nix store into the tmpfs.

> <https://github.com/NixOS/nixpkgs/blob/1cd347bf3355fce6c64ab37d3967b4a2cb4b878c/nixos/modules/security/wrappers/default.nix>

---

_[View the full topic](https://discourse.nixos.org/t/get-size-of-nix-store-efficiently/51354)._
