This leads to incredibly wasteful refreshes (see [^]) when oids are not found. Since we are writing the pack files only once per unpacking we should not bother with this refreshing at all. This brings down the number of syscalls during `nix flake metadata "https://releases.nixos.org/nixos/25.05/nixos-25.05.813095.1c8ba8d3f763/nixexprs.tar.xz" --store "dummy://?read-only=false"` Down from 576334 to just 6235 (100x less syscalls): (Before) % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 32.98 0.625288 3 162898 getdents64 29.58 0.560686 3 163514 81917 openat 15.01 0.284509 3 81819 186 newfstatat 10.99 0.208349 2 81601 close 10.56 0.200145 2 81552 fstat All these are coming from [2] and are totally useless. (After) % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 76.47 0.108558 247 438 20 futex 6.55 0.009292 18 513 munmap 3.30 0.004680 7 639 492 openat 2.68 0.003803 10 359 write 2.30 0.003268 2 1146 read 2.26 0.003215 3 870 mmap [^]:58d9363f02/include/git2/sys/odb_backend.h (L68-L75)[2]:58d9363f02/src/libgit2/odb_pack.c (L517-L546)
Nix
Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.
Installation and first steps
Visit nix.dev for installation instructions and beginner tutorials.
Full reference documentation can be found in the Nix manual.
Building and developing
Follow instructions in the Nix reference manual to set up a development environment and build Nix from source.
Contributing
Check the contributing guide if you want to get involved with developing Nix.
Additional resources
Nix was created by Eelco Dolstra and developed as the subject of his PhD thesis The Purely Functional Software Deployment Model, published 2006. Today, a world-wide developer community contributes to Nix and the ecosystem that has grown around it.
- The Nix, Nixpkgs, NixOS Community on nixos.org
- Official documentation on nix.dev
- Nixpkgs is the largest, most up-to-date free software repository in the world
- NixOS is a Linux distribution that can be configured fully declaratively
- Discourse
- Matrix: #users:nixos.org for user support and #nix-dev:nixos.org for development
License
Nix is released under the LGPL v2.1.