I’m a long time but non-expert user of NixOS. I found out today about two experimental Nix features (both seemingly spearheaded by @edolstra): flakes and nix-command. These look amazing.
I have two questions:
What is the best way to use these features in NixOS?
What is the roadmap for integrating either of these into Nix?
Edit: Really what I’m asking in #1 is how I can use the features showcased in the Tweag blog post on NixOS. I am on the unstable channel and I have added nixFlakes to my packages. I do not know where to add the experimental-features line, since ~/.config/nix/nix.conf does not exist and nix.extraOptions doesn’t seem right either. Maybe I am using nix-command since I can now use e.g. nix build, but I do not have e.g. nix dev-shell.
You can actually create ~/.config/nix/nix.conf and it will be respected even on NixOS. It’s just extra options for specific user, by default home directories are not managed by Nix unless you install home-manager.
nix.extraOptions could also work but it would be global.
to my NixOS config, it results in warning: unknown setting 'experimental-features' whenever running Nix.
Similarly running nix --experimental-features nix-command dev-shell results in error: unrecognised flag '--experimental-features'.
Running nix --version gives nix (Nix) 2.3.4. Do I need to do something to manually upgrade it past nixpkgs unstable?
Edit: If I install nixFlakes explicitly with nix-shell, I do get access to dev-shell and flakes (but still not nix shell like the blog post). Still not understanding why installing nixFlakes in my NixOS systemPackages didn’t work, do I need to keep it from being overwritten by the default nix command?
I would like to use these features for a project that I contribute to, but I don’t want to require users to figure out how to use experimental features - is there a roadmap for when these features will land in stable Nix? Nix 3.0? I don’t know where to look for that information.