First, a suggestion. Put your flake somewhere else (eg. in $HOME/projects/my-flake or wherever) and leave the non-flake version that works in /etc/nixos, so if stuff breaks, you can start over with a nixos-rebuild Try putting this in your configuration.nix and do a rebuild before switching to flakes: nix = { package = pkgs.nixUnstable; extraOptions = "experimental-features = nix-command flakes"; }