This is my personal NixOS setup with basically my whole system as-is. :)
- Boot NixOS installer
- Clone this repo
- Run:
sudo ./install.sh
- Log in with default password
changeme
- Configuration is installed to
~/nixos-dev
After installation, the configuration lives in ~/nixos-dev
. To make changes and rebuild:
# Edit files in ~/nixos-dev
cd ~/nixos-dev
# Make your changes...
# Then use one of these aliases to sync and rebuild:
nrs # nixos-sync: Sync to /etc/nixos and rebuild switch
nrt # nixos-test: Sync and rebuild test
nrb # nixos-boot: Sync and rebuild boot
The aliases automatically:
- Sync your changes from
~/nixos-dev
to/etc/nixos
- Stage changes in git (so Nix in
/etc/nixos
can find all files, even if they're unstaged in~/nixos-dev
) - Run the appropriate nixos-rebuild command
#Set hostname
export HOST=confect1on # or laptop
# Format disks with disko
echo "Formatting disks..."
nix --experimental-features "nix-command flakes" \
run github:nix-community/disko -- \
--mode disko \
--flake "${SCRIPT_DIR}#${HOST}"
# Install NixOS
echo "Installing NixOS..."
nixos-install --flake "${SCRIPT_DIR}#${HOST}" --no-root-passwd