It turns out that libgit2 is incredibly naive and each git_writestream creates a new temporary file like .cache/nix/tarball-cache/objects/streamed_git2_6a82bb68dc0a3918 that it reads from afterwards. It doesn't do any internal buffering. Doing (with a fresh fetcher cache) a simple: strace -c nix flake metadata "https://releases.nixos.org/nixos/25.05/nixos-25.05.813095.1c8ba8d3f763/nixexprs.tar.xz" --store "dummy://?read-only=false" (Before) % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 31.05 2.372728 9 259790 81917 openat 19.21 1.467784 30 48157 unlink 10.43 0.796793 4 162898 getdents64 7.75 0.592637 4 145969 read 7.67 0.585976 3 177877 close 7.11 0.543032 4 129970 190 newfstatat 6.98 0.533211 10 48488 write 4.09 0.312585 3 81443 81443 utimensat 3.22 0.246158 3 81552 fstat (After) % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 29.61 0.639393 3 162898 getdents64 26.26 0.567119 3 163523 81934 openat 12.50 0.269835 3 81848 207 newfstatat 11.60 0.250429 3 81443 81443 utimensat 9.82 0.212053 2 81593 close 9.33 0.201390 2 81544 fstat 0.18 0.003814 9 406 17 futex |
||
|---|---|---|
| .github | ||
| ci/gha | ||
| contrib | ||
| doc/manual | ||
| maintainers | ||
| misc | ||
| nix-meson-build-support | ||
| packaging | ||
| scripts | ||
| src | ||
| tests | ||
| .clang-format | ||
| .clang-tidy | ||
| .coderabbit.yaml | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitignore | ||
| .shellcheckrc | ||
| .version | ||
| CITATION.cff | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| default.nix | ||
| docker.nix | ||
| flake.lock | ||
| flake.nix | ||
| HACKING.md | ||
| meson.build | ||
| meson.format | ||
| meson.options | ||
| README.md | ||
| shell.nix | ||
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.