nix.dev
nix.dev copied to clipboard
Restructure FAQ section
Problem statement
Currently the FAQ sections on nix.dev and the NixOS Wiki are an unstructured collection of question-answer pairs. Some of them are for troubleshooting, some of them are actual recipes for performing common tasks, some are conceptual in nature.
Objective
Since many answers are not as helpful as they could be, we will sort through all questions, and for each make a PR that updates the answer and adds it to the appropriate category on nix.dev.
Tasks
- [ ] Check each question on NixOS Wiki: FAQ
- [ ] Make a PR for each question on nix.dev below
Troubleshooting
- What to do if a binary cache is down or unreachable?
- How do I fix: error: querying path in database: database disk image is malformed
- How do I fix: error: current Nix store schema is version 10, but I only support 7
- I’m getting: writing to file: Connection reset by peer
Recipes
- How do I add a new binary cache?
- How do I force Nix to re-check whether something exists at a binary cache?
- How to operate between Nix paths and strings?
- How to build reverse dependencies of a package?
- How can I manage dotfiles in $HOME with Nix?
- What’s the recommended process for building custom packages? = "How to build a custom package?" – doesn't have a proper response
Concepts
SHENNANIGAN and tradeoffs
nix limitations:
- moving files into immutable nix store instead of creation of overlayfs due to posix performance and nesting limits
- namespace control tools (fs sandbox with bubblewrap) => a chroot is no sandbox and can be (easily) escaped
- package categories (missing metadata)
- portability (see https://github.com/NixOS/nixpkgs/issues/26850)
- debugging experience (tooling, documentation, best practice) see also https://blog.wesleyac.com/posts/the-curse-of-nixos
flakes limitations:
- dependency explosion problem (like crates in Rust)
- system deps not inheritable
- slow for big repos (big artifacts are copied into nix store)
- no way to add dependencies from outside git repo without git repo (fs with hashing and/or internal hashing system could be used if user space can be sufficiently trusted not to mess with output artifacts) see also https://discourse.nixos.org/t/experimental-does-not-mean-unstable-detsyss-perspective-on-nix-flakes/32703
@matu3ba would be great if you would make a PR for any of those items, the @NixOS/documentation-team will gladly review it to get it merged.