After NixOS installation, in your ~
directory:
- Copy config:
git clone git@github.com:wendingtuo/nixos.git
cd ~/nixos/hosts
cp -r nixos <your_hostname>
cd <your_hostname>
cp /etc/nixos/hardware-configuration.nix ./
sudo nixos-rebuild switch --flake ./
home-manager switch --flake ./
-
Change
user = "blake";
and{ hostname = "nixos"; stateVersion = "24.11"; }
lines inflake.nix
to match your system. -
Rebuild:
cd nixos
git add .
sudo nixos-rebuild switch --flake .
home-manager switch --flake .
Credit to VelHRH/nixos-config
for the inspiration and structure