Shell commands in `Other Useful Tips` section are incorrect
mikelane opened this issue · comments
The current version has this:
sudo mv /etc/nixos /etc/nixos.bak # Backup the original configuration
sudo ln -s ~/nixos-config/ /etc/nixos
# Deploy the flake.nix located at the default location (/etc/nixos)
sudo nixos-rebuild switch
However, the backup command will move the directory, not copy it and the symlink has the parameters in the wrong order so it will create a symlink to ~/nixos-config in the /etc/nixos directory. It should be this:
sudo cp -r /etc/nixos /etc/nixos.bak # Backup the original configuration
sudo ln -s /etc/nixos ~/nixos-config
# Deploy the flake.nix located at the default location (/etc/nixos)
sudo nixos-rebuild switch
The current version of commands also makes sense. It depends on what the outcome should be. The current version moves the nix files to your home folder and only leaves a symlink for the system to find it.
Your version leaves the files in the system wide location and creates a symlink in your home to it. Not sure if this symlink is even read by any tooling or if it would be just convenience for the user.