top | item 35040221

(no title)

johnvaluk | 3 years ago

For a feature that isn't enabled by default, "just use Nix Flakes" hardly qualifies as best practice or even commonplace.

I've used Nix/NixOS for years and still don't have a use case for flakes. I only enabled it this week to restore some functionality to the nix command, which is still a work in progress.

Getting there was painful and required a deep dive into the documentation. In the end, it was as simple as adding this line to my configuration.nix:

  nix.settings.experimental-features = [ "nix-command" "flakes" ];
The flexibility of Nix is one of its main selling points, so it's impossible to say that "everyone" uses it in a similar way. Flakes are a welcome, but disruptive, enhancement. Hopefully, the experimental phase will end soon.

discuss

order

williamvds|3 years ago

I've got a simple use case: reproducibly building a random derivation from someone's Git repo.

If they haven't pinned nixpkgs, I have no idea at what point it _was_ building successfully. It's just dumb luck whether my system's channel is a compatible nixpkgs.

If it's pinned, great, I can use that pin until I'm bothered to bring it back to mainline. At that point I'll override the nixpkgs input and bear the cost of updating and maintaining it.

Flakes make managing pins those easier, through a nice(r) CLI, and a standard format for them.

ingenieroariel|3 years ago

Most hardcore Nix users/developers I have met have been suspicious for Flakes for several years, so your point rings true.

That said, it feels like they are slowly coming to terms with it and just accepting it as default. Here are two examples of maintainers eventually accepting flake support on their repos after initial hesitation [1][2].

[1] https://github.com/tpwrules/nixos-apple-silicon/pull/47 [2] https://github.com/NixOS/mobile-nixos/pull/404

toastal|3 years ago

Counter anecdote: all of the hardcore Nix users/developers convinced me it was worth it to switch to Flakes now. They even helped me move my NixOS config as well.

baby|3 years ago

It sounds like a python 2 vs python 3 kind of deal, which intuitively makes me think that you should just use flakes

mikepurvis|3 years ago

I'm a relative newcomer too— started about two years ago with a Flake-only workflow on Nix 2.3. My sense in observing the debate over this time is that about 20% of the objections are technical in nature, while 80% are around governance— feeling that the feature was smuggled into the main repo as a prototype, despite there being existing external projects (niv) that were trying to accomplish a lot of the same things.