Keystone OS install
Complete guide for installing NixOS using the Keystone installer ISO and nixos-anywhere.
Prerequisites
- Keystone ISO generated and burned to USB (see ISO Generation)
- Target machine capable of booting from USB
- Network connectivity for the target machine
Overview
Keystone uses a two-phase installation approach:
- Boot Phase: Boot target machine from USB installer
- Installation Phase: Use nixos-anywhere with disko to install the root system
- First Boot: Systemd units automatically configure additional disks and ZFS pools
Phase 1: Boot from USB
- Boot the target machine from the Keystone USB installer
- Wait for the system to fully boot and auto-configure networking
- Get the IP address:
ip addr show - Note the IP address for remote installation
Note: Headless installation procedures are not yet documented. You'll need console access to retrieve the IP address.
Phase 2: Install with nixos-anywhere
Prerequisites
- Target machine booted from Keystone ISO
- SSH connectivity to the installer
- Disko configuration file (disko.nix)
Run Installation
# From your local machine with your NixOS configuration
nixos-anywhere --flake .#your-config root@<installer-ip>The installation process:
- Disko partitions and formats the root disk only
- nixos-anywhere installs the base NixOS system
- System reboots into the installed OS
What Disko Handles
Disko configures the root disk with:
- Partitioning (UEFI boot, swap, root)
- LUKS encryption (if configured)
- ZFS root pool creation
- Essential datasets for NixOS
Phase 3: First Boot and Additional Disks
Automatic Disk Initialization
On first boot, systemd units automatically:
- Detect additional disks not managed by disko
- Create ZFS pools on additional drives
- Reuse encryption keys from root disk for additional LUKS devices
- Create ZFS datasets with appropriate properties
- Set up mount points and permissions
Post-Boot Configuration
The NixOS modules include systemd units that handle:
- Additional storage pools: Data storage, backups, media
- ZFS dataset creation: With compression, encryption, snapshots
- TPM integration: After initial manual unlock and attestation
- Secure boot setup: Key generation and enrollment
Verification
After first boot, verify the installation:
# Check ZFS pools
zpool list
zfs list
# Check systemd services
systemctl status keystone-*
# Check disk encryption
lsblk -fConfiguration Examples
Client Configuration
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
keystone.url = "github:ncrmro/keystone";
};
outputs = { nixpkgs, keystone, ... }: {
nixosConfigurations.client = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
keystone.nixosModules.client
./hardware-configuration.nix
{
# Your custom configuration
users.users.myuser = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
}
];
};
};
}Server Configuration
nixosConfigurations.server = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
keystone.nixosModules.server
./hardware-configuration.nix
{
# Server-specific configuration
services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
}
];
};Troubleshooting
Network Issues
# Check network status on installer
ip addr show
systemctl status dhcpcd
# Test connectivity
ping 8.8.8.8SSH Connection Problems
# Verify SSH is running
systemctl status sshd
# Check SSH configuration
cat /etc/ssh/sshd_config
# View authorized keys
cat ~/.ssh/authorized_keysInstallation Failures
# Check disko output
journalctl -u disko
# Verify disk configuration
lsblk -fSecurity Notes
- The installer allows root SSH access with key-based authentication only
- Password authentication is disabled
- Consider using dedicated SSH keys for the installer
- The ISO contains your public keys - treat it accordingly
- LUKS encryption keys are automatically managed across disks
Next Steps
After successful installation:
- Configure users and access control
- Set up backup destinations
- Configure VPN and networking
- Install application-specific services
- Enable automatic updates
See the main README for infrastructure architecture and service configuration options.