nix-shell -p git --run "git clone https://github.com/2zqa/nix.git && cd nixrm ./hardware-configuration.nix && sudo cp /etc/nixos/hardware-configuration.nix . && sudo chown $USER:users ./hardware-configuration.nixsudo nixos-rebuild switch --flake ~/nix#lonepine- Reboot the system, ensuring everything works
sudo nix-channel --remove nixos(Maybe not needed?)
- Philipp Schuster for writing Migrate Default NixOS Configuration to Flake