Discussion of flakes, from 2025 NixOS Community Survey Report

Can’t we just make it a first class module opt in, and have NixOS-flaky and NixOS-original

NixOS-flaky - configuration.nix

options.flakes.enable = true;
options.nix-command.enable = true;

flakes come with certain caveats, see nixos.org/flakes

/

NixOS-original - configuration.nix

options.flakes.enable = false;
options.nix-command.enable = false;

flakes come with certain caveats, see nixos.org/flakes — enable at discretion

2 Likes

The problem is that currently this looks like “disagree and commit unpaid volunteers to technical work they are uninterested in doing”.

If this were a healthier community the people constantly wailing about flakes experimental status would step up and ship the feature.

ALSO: look at how we are talking about not changing flakes. If we can’t break flakes now, we which are explicitly marked experimental then I see no particular reason why they will changeable in the future.

7 Likes

One thing that I don’t see mentionned in the comments is the size+complexity of the Nix codebase, which might prevent new-comers to even try to patch anything in nix. Is the nix+flakes becoming too complex to be maintained ? Should the nix scope be narrowed down to its core, by extracting/delegating the convenient/helper features ? From various posts in Discourse, some parts of current Nix could be delegated (ex: fetchers by Nixtamal, profiles/homes by hjem, others ?).

This sounds like a never ending story with Nix developpers burning efforts trying to make Nix capable of everything, but as the Nix codebase is unworkable for new-comers and as it’s impossible for Nix to achieve everything, there continuously are some new tools created around Nix to achieve the last few things missing.

1 Like

From Curious about system.nix

”If you’re already using flakes you probably have no use for this.”

I imagine that may or may not change in the future. For now it is early days still.

1 Like

Honestly, I think we should use system.nix for both flakes and non-flakes. Sharing a codepath would mean better docs and fewer bugs.

We could use builtins.getFlake to significantly simplify stuff in nixos-rebuild.

3 Likes

We can’t without breaking functionality. Currently it follows symlinks and getFlake wouldn’t work.
Also getFlake has some massive bugs, e.g. nixos-rebuild-ng: fix repl behaving differently on git flakes than bu… by Mic92 · Pull Request #375493 · NixOS/nixpkgs · GitHub

I don’t really see a reason to use system.nix with flakes in any case.

1 Like