ryan4yin / nixos-and-flakes-book

:hammer_and_wrench: :heart: Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial? Then you've come to the right place! 想要学习使用 NixOS 与 Flakes 吗?在寻找一份新手友好的教程?那你可来对地方了!

Home Page:https://nixos-and-flakes.thiscute.world

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

@XenGi Yeah, I don't think there should be any changes here.