X13Gen2 uses LUKS encryption with Btrfs and impermanence. Follow these steps for a fresh installation.
- NixOS installation USB
- Another machine with Nix installed (Mac, Linux, etc.)
- Network connectivity (Ethernet or WiFi)
- LUKS passphrase (strong, memorable)
# Set up network
sudo systemctl start NetworkManager
nmtui # Connect to WiFi if needed# Set password for nixos user (for SSH login)
passwd
# Check IP address
ip addrRun 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_PASSsudo rebootIf you don’t have another machine available, use this traditional method.
nix-shell -p git
git clone https://github.com/takeokunn/nixos-configuration
cd nixos-configuration# 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_PASSWARNING: 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# Increase file descriptor limit for large builds
ulimit -n 65536
sudo nixos-install --flake .#X13Gen2 --no-root-passwd --cores 1 --max-jobs 1sudo rebootAfter installation, use this command to apply configuration changes:
sudo nixos-rebuild switch --flake .#X13Gen2 --show-trace- 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