nix-shell -p git
git clone https://github.com/sumitftr/nixos-config.git
cd nixos-config
Add host by doing:
./host add <HOSTNAME>
git add .
sudo nixos-rebuild switch --flake .#<HOSTNAME>
Link your configs by doing:
./init.sh
For updating package versions you have to update
flake.lock
file. To do that, run:nix flake update
. Then stage theflake.lock
file usinggit add -u
.
Moving Configuration: Copy this flake to your preferred path. Run
./init.sh
to recreate symlinks to your present configuration path. Then you can delete the original flake.
Sometimes nixos doesn't allows user to rebuild from configuration flake due to ownership problems. To get around this, run:
sudo chown -R <USERNAME>:users .