What's that thing with --extra-experimental-features?

So I tried to follow some tutorial about flakes, but it seems these are extra-experimental still.

I am using NixOS 23.11 with Nix 2.18.1 in a VM (those are the most recent stable versions, right?).

Trying around I already found out that instead of eg. nix flake update I have to use –extra-experimental-features two times to get this simple command:


<span style="color:#323232;">nix --extra-experimental-features nix-command --extra-experimental-features flakes flake update
</span>

Searching the web I found several different things that people put into their /etc/nixos/configuration.nix to enable this globally, but none of those worked for me. I assume there is still a way to do this - can someone please tell me the correct syntax for Nix 2.18.1?

What makes things worse is that I cannot start playing around with home-manager and flakes, because home-manager switch flake . seems to use nix flake internally, which leads to errors instead of results.

sandro,
@sandro@c3d2.social avatar

@silmaril You can combine the flag --extra-experimental-features "nix-command flakes" or use nix.settings.extra-experimental-features = [ "nix-command" "flakes" ];

silmaril,
@silmaril@discuss.tchncs.de avatar

Thank you very much!

nix.settings.extra-experimental-features = [ “nix-command” “flakes” ];
seems to actually work in my setup.

And it’s nice to know that I can make do with one –extra-experimental-features argument for several features at once.

May I be so bold as to ask a follow-up question that doesn’t have much to do with this one?

What do I have to do to get Virtualbox Guest Additions to work on NixOS? Not having a shared clipboard is driving me crazy ;-)

Once again everything I found on the internet leads to errors during sudo nixos rebuild. I hope it’s just another case of knowing the correct names for the actual packages or options to use.

Can someone help me here?

hallettj,
@hallettj@leminal.space avatar

Looking at the configuration options I think you want this line in configuration.nix:


<span style="color:#323232;">virtualisation.virtualbox.guest.enable = true;
</span>
silmaril,
@silmaril@discuss.tchncs.de avatar

Yes! That’s the correct way to write this, thank you! 😊

And it’s already set inside /etc/nixos/hardware-configuration.nix after installing inside a VM.

I had an additional layer 8 problem - clipboard sharing doesn’t work until it’s enabled in the VirtualBox host , too 🙃

  • All
  • Subscribed
  • Moderated
  • Favorites
  • nixos@infosec.pub
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • Durango
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ngwrru68w68
  • kavyap
  • tacticalgear
  • ethstaker
  • JUstTest
  • InstantRegret
  • Leos
  • normalnudes
  • everett
  • khanakhh
  • osvaldo12
  • cisconetworking
  • modclub
  • anitta
  • tester
  • megavids
  • provamag3
  • lostlight
  • All magazines