What line do I have to write to enable flakes in nixos?
- User
What line do I have to write to enable flakes in nixos?
Assistant
To enable flakes in NixOS, add this line to your
configuration.nix:nix.settings.experimental-features = [ "nix-command" "flakes" ];After modifying the configuration, apply the changes with:
sudo nixos-rebuild switchImportant notes:
- NixOS version: This works for NixOS 22.05 and newer. Older versions (e.g., 21.11) require upgrading NixOS first[3][9].
- Alternative methods:
- For non-NixOS systems, use
~/.config/nix/nix.confwith:experimental-features = nix-command flakes - Temporary enablement via CLI flags:
nix --extra-experimental-features 'nix-command flakes' ... ```[4][11]
- For non-NixOS systems, use
For full flake integration, consider migrating to a configuration[1][9].
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.