- Download and extract this repository at your home directory:
nix-shell -p git && cd && git clone git@github.com:DioKyrie-Git/NixOS.gitNote
- This will temporarily install git
- This will set current directory to ~/
- Then will download this GitHub repository.
Caution
- Before proceeding please do the following:
- Personalise all settings in ~/NixOS/flake.nix
- User name;
- Locale;
- GitHub credentials;
- Et cetera.
- Run in terminal:
rsync -a --delete -v /etc/nixos/hardware-configuration.nix ~/NixOS/ && rsync -a --mkpath --delete -v /etc/nixos/ ~/.config/NixOS/.backup/ && sudo rm /etc/nixos/* && nix flake lock ~/NixOS/ && sudo rsync -a --delete -v ~/NixOS/* /etc/nixos/ && sudo nixos-rebuild switch --flake /etc/nixos#CubozoaWarning
- This will copy your hardware-configuration.nix to ~/NixOS/
- This will backup your /etc/nixos/ in ~/.config/NixOS/.backup/
- Then will delete all files in /etc/nixos/
- Then will generate lock file with
nix flake lockin ~/NixOS/ - Then will copy all contents of ~/NixOS/ to /etc/nixos/
- Then will use
nixos-rebuild switchwith--flakeflag.
- Now you can update your NixOS with terminal command:
nixos-updateTip
- This will copy your hardware-configuration.nix to ~/NixOS/
- Then will delete all files in /etc/nixos/
- Then will update lock file with
nix flake lockin ~/NixOS/ - Then will copy all contents of ~/NixOS/ to /etc/nixos/
- Then will use
nh os switchto update your NixOS.
Important
- While using my Flake, you should only edit files in ~/NixOS/
- Never edit files in /etc/nixos/