/dotnix

NixOS configuration files

Primary LanguageNixMIT LicenseMIT

NixOS setup

Initial disk setup

Prerequisites

Nix-flakes

mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf

Darwin Setup

Initial

nix-env -iA nixos.git
git clone https://github.com/ddervisis/dotnix ~/dotnix
cd ~/dotnix
nix build .#darwinConfigurations.<host>.system
./result/sw/bin/darwin-rebuild switch --flake .#<host>

Rebuild

darwin-rebuild switch --flake .#<host>

Linux Setup

Generate NixOS config

nixos-generate-config --root /mnt

Clone Nix config files repo

nix-env -iA nixos.git
git clone https://github.com/ddervisis/dotnix /mnt/etc/nixos/dotnix

Switch hardware-configuration

cp /mnt/etc/nixos/dotnix/hosts/<host>/hardware-configuration.nix /mnt/etc/nixos/

Start installation

cd /mnt/etc/nixos/dotnix
nixos-install --flake .#<host>

Reboot

reboot

Set user password

# login as root in tty1
passwd $USER

SSH key setup

# login as $USER
mkdir -p ~/.ssh
curl https://github.com/${USER}.keys | tee -a ~/.ssh/authorized_keys