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

Flag to enable flakes right away #12

Open
BentonEdmondson opened this issue Jul 12, 2021 · 4 comments
Open

Flag to enable flakes right away #12

BentonEdmondson opened this issue Jul 12, 2021 · 4 comments

Comments

@BentonEdmondson
Copy link

My configuration is a flake. Can you add a flag or something to enable flakes in configuration.nix right away? You just need to add

nix.package = nixUnstable;
nix.extraOptions = "experimental-features = nix-command flakes";

This way I can go straight to git clone ... . and sudo nixos-rebuild switch --flake .#host without worrying about enabling flakes.

@samuela
Copy link
Owner

samuela commented Jul 20, 2021

Thanks for your feedback! Tbh I'm torn on this issue. My goal with nixos-up is to have as few knobs as possible, with the goal of getting users into a working installation as quickly as possible so that they can then make changes from there. OTOH, I'd also like nixos-up to lean towards best practices by default, even bordering on opinionated. That's the rationale behind automatically setting the user up with home-manager, using passwordFile, disabling root login, etc.

So at the end of the day it really comes down to whether or not nixUnstable is considered "best practices" yet. AFAICT the NixOS community is tragically stuck on this issue... It hasn't made it into nix mainline yet, but also we've sort of been told that flakes are the future. So one day? I'll be the first to admit I'm confused with where the situation lies at this point in time. It seems like most power users are already on flakes, but adoption has been shaky at best. Is the NixOS community heading towards a schism? Idk.

@BentonEdmondson
Copy link
Author

I'm glad you're keeping this project lean. I don't think experimental features shouldn't be the default, but I'm suggesting that you add a CLI argument (although I don't know how easy this would be to do with how you have things set up) to enable flakes right away.

It's up to you of course, but either way I understand your reasoning.

@montchr
Copy link

montchr commented Apr 24, 2022

FWIW:

Since the time period around last comment here, I've seen flakes support in various projects continue to grow. While the flakes API is still somewhat experimental, I consider it stable enough for general usage. Every once in a while, API features are deprecated, but with plenty of notice – I've never run into a situation where some part of the flakes API just stops working suddenly.

In my experience, though I use flakes primarily, I can still use the nix-* commands in addition to the new nix * (without the dash) commands. I'm not positive, but I think flagging the experimental nix-command and flakes options on does not prevent the old behavior.

@samuela
Copy link
Owner

samuela commented Apr 25, 2022

Agreed, seems like flakes have picked up steam now. I'd be open to a PR that enables flakes. Preferably no CLI flag; just enabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants