Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAQ: should I enable flakes #547

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions source/recipes/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

## Nix

### Should I enable flakes?

You have to judge for yourself based on your needs.

Flakes and the `nix` command suite bring multiple improvements that are relevant for both software users and package authors:
- The new command line interface, together with flakes, makes dealing with existing packages significantly more convenient.
- The constraints imposed on flakes strengthen reproducibility by default, and enable various performance improvements when interacting with a large Nix package repository like {term}`Nixpkgs`.
- Flake references allow for easier handling of version upgrades for existing packages or project dependencies.
- The flake schema helps with composing Nix projects from multiple sources in an ordered fashion.

Other than that, and below the surface of the flake schema, Nix and the Nix language work the exactly same in both cases.
Nix offers the same reproducibility guarantees with or without flakes, when used correctly.
fricklerhandwerk marked this conversation as resolved.
Show resolved Hide resolved
In particular, the process of adding software to {term}`Nixpkgs` or maintaining {term}`NixOS` modules and configurations is not affected by flakes at all.

Both paradigms have their own set of unique concepts and support tooling that have to be learned, with varying ease of use, implementation quality, and support status.
At the moment, neither the stable nor the experimental interface is clearly superior to the other in all aspects.
While flakes reduce complexity in some regards, they introduce additional concepts and you will have to learn more about the system to fully understand how it works.

There are downsides to relying on [experimental features](https://nixos.org/manual/nix/stable/contributing/experimental-features.html) in general:
- Interfaces and behavior of experimental features could still be changed by Nix developers.
This may require you to adapt your code at some point in the future, which will be more effort when it has grown in complexity.
Currently there is no agreed-upon plan or timeline for stabilising flakes.
- The [Nix maintainer team](https://nixos.org/community/teams/nix.html) focuses on fixing bugs and regressions in stable interfaces, supporting well-understood use cases, as well as improving the internal design and overall contributor experience in order to ease future development.
Improvements to experimental features have low priority.
- The [Nix documentation team](https://nixos.org/community/teams/documentation.html) focuses on improving documentation and learning materials for stable features and common principles.
Using flakes, you will have to rely more heavily on user-to-user support, third-party documentation, and the source code.

### What to do if a binary cache is down or unreachable?

Pass `--option substitute false` to Nix commands.
Expand Down