Skip to content

Latest commit

 

History

History
119 lines (84 loc) · 2.85 KB

File metadata and controls

119 lines (84 loc) · 2.85 KB

First Installation (X13Gen2)

X13Gen2 uses LUKS encryption with Btrfs and impermanence. Follow these steps for a fresh installation.

Prerequisites

  • NixOS installation USB
  • Another machine with Nix installed (Mac, Linux, etc.)
  • Network connectivity (Ethernet or WiFi)
  • LUKS passphrase (strong, memorable)

Step 1: Boot NixOS Installer USB

# Set up network
sudo systemctl start NetworkManager
nmtui  # Connect to WiFi if needed

Step 2: Enable SSH Access (on target machine)

# Set password for nixos user (for SSH login)
passwd

# Check IP address
ip addr

Step 3: Run nixos-anywhere (Recommended)

Run this from another machine (Mac, Linux, etc.).

WARNING: This will erase all data on the target disk.

# First, verify SSH connectivity
ssh nixos@<TARGET_IP>  # e.g., nixos@192.168.1.100

# Create password file securely (avoids shell history exposure)
read -s -p "Enter LUKS passphrase: " LUKS_PASS

# Run nixos-anywhere
nix run github:nix-community/nixos-anywhere -- \
  --flake github:takeokunn/nixos-configuration#X13Gen2 \
  --disk-encryption-keys /tmp/luks-password <(printf '%s' "$LUKS_PASS") \
  nixos@<TARGET_IP>

unset LUKS_PASS

Step 4: Reboot

sudo reboot

Manual Installation (Fallback)

If you don’t have another machine available, use this traditional method.

Step 1: Clone Configuration

nix-shell -p git
git clone https://github.com/takeokunn/nixos-configuration
cd nixos-configuration

Step 2: Create LUKS Password File

# Create password file securely (avoids shell history exposure)
read -s -p "Enter LUKS passphrase: " LUKS_PASS
printf '%s' "$LUKS_PASS" > /tmp/luks-password
chmod 600 /tmp/luks-password
unset LUKS_PASS

Step 3: Run Disko (Partitioning & Formatting)

WARNING: This will erase all data on the target disk.

sudo nix --experimental-features "nix-command flakes" run \
  github:nix-community/disko/latest -- \
  --mode destroy,format,mount \
  ./hosts/X13Gen2/disko-config.nix

Step 4: Install NixOS

# Increase file descriptor limit for large builds
ulimit -n 65536
sudo nixos-install --flake .#X13Gen2 --no-root-passwd --cores 1 --max-jobs 1

Step 5: Reboot

sudo reboot

Update Configuration

After installation, use this command to apply configuration changes:

sudo nixos-rebuild switch --flake .#X13Gen2 --show-trace

Notes

  • This configuration uses LUKS encryption for full disk encryption
  • Btrfs filesystem with subvolumes for efficient snapshots
  • Impermanence module for stateless system management
  • home-manager is integrated with advanced profile