Skip to content

Latest commit

 

History

520 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NixOS Configuration

A declarative NixOS configuration for single-user workstations using Flakes and Disko, featuring Hyprland with Lumen Desktop Shell.

The Fedora 44 installation of the Dell XPS is managed separately, without Nix, by the Ansible configuration in the fedora-config repository.

Features

  • Declarative disk partitioning with Disko
  • Full disk encryption with LUKS2 (interactive passphrase at boot)
  • Btrfs filesystem with subvolumes and zstd compression
  • Passwordless auto-login via greetd (password set after first boot)
  • Hyprland window manager with Lumen Desktop Shell
  • Home Manager integration for user configuration

Hosts

Host Description GPU
kraken Desktop PC AMD Radeon RX 7700 XT / 7800 XT
thebeast Threadripper workstation AMD Radeon RX 7700 XT / 7800 XT
G1a HP ZBook Ultra G1a AMD Strix Halo (RDNA 3.5)
z2-mini-g1a HP Z2 Mini G1a Workstation AMD Strix Halo (RDNA 3.5)
proart ASUS ProArt P16 OLED AMD + NVIDIA RTX 5090
xps Dell XPS 14 Intel Panther Lake

Partition Layout

Partition Size Filesystem Description
ESP 2 GB FAT32 EFI boot partition (/boot)
Root Remaining Btrfs (LUKS2) Encrypted root with subvolumes

Btrfs Subvolumes

Subvolume Mount Point Purpose
@ / Root filesystem
@home /home User home directories
@nix /nix Nix store
@var-log /var/log System logs

Swap is handled by zram (25% of RAM) - no swap partition.

Installation

Prerequisites

  • Official NixOS minimal ISO (download from nixos.org)
  • UEFI-capable system
  • Internet connection (Ethernet or WiFi)

Step 1: Boot the NixOS ISO

Boot from the NixOS minimal ISO. You'll be logged in as nixos with root privileges.

Step 2: Connect to the Internet

For WiFi:

nmtui

Select "Activate a connection" and connect to your network.

For Ethernet: Should work automatically.

Verify connectivity:

ping -c 1 github.com

Step 3: Run Forge

Official NixOS minimal ISO: The stock installer ISO does not enable flakes for ad-hoc nix run, so use:

nix --extra-experimental-features "nix-command flakes" run github:DigitalPals/nixos-config#forge

Forge ISO built from this repo: Forge starts automatically on login. If you need to restart it manually:

forge-startup

Run the Forge installer directly from the flake:

nix --extra-experimental-features "nix-command flakes" run github:DigitalPals/nixos-config#forge

The interactive TUI will guide you through:

  1. Select your host (kraken, thebeast, G1a, z2-mini-g1a, proart, or xps)
  2. Select the target disk
  3. Choose your user account and swap mode
  4. Choose whether to keep the checked-in hardware profile or generate a live hardware layer
  5. Confirm the installation (type 'yes')

Forge keeps the checked-in hardware profile by default. If you want live machine detection, opt into it during the hardware profile step or use the command-line flag below.

Alternatively, run with arguments for non-interactive install:

nix --extra-experimental-features "nix-command flakes" run github:DigitalPals/nixos-config#forge -- install kraken /dev/nvme0n1

To opt into a live hardware refresh from the command line:

nix --extra-experimental-features "nix-command flakes" run github:DigitalPals/nixos-config#forge -- install xps /dev/nvme0n1 --refresh-hardware

Step 4: Wait for Installation

The installer will:

  1. Partition and format the disk
  2. Mount the filesystems
  3. Install NixOS with your configuration
  4. This typically takes 10-30 minutes depending on your internet speed

Step 5: Reboot

reboot

Post-Installation

First Boot

  1. Enter your LUKS passphrase at the boot prompt
  2. You'll be automatically logged in as john (no password required)
  3. Set your user password:
    passwd

CLI Tool Installs (Codex + Claude)

Codex CLI (npm) and Claude Code are installed via Home Manager activation. This is best-effort:

  • If online, they are installed on first activation.
  • If offline, installation is skipped and retried on the next activation.

Clone Your Configuration

For future modifications:

git clone https://github.com/DigitalPals/nixos-config.git ~/nixos-config
cd ~/nixos-config

Rebuilding the System

After making changes to the configuration:

sudo nixos-rebuild switch --flake ~/nixos-config#G1a

Or use the included alias:

nrs  # nixos-rebuild switch

Rust build offload with sccache-dist

All normal workstation profiles include Rust sccache defaults. Without a token, this behaves as a local compiler cache. To enable distributed Rust compilation via the Beast rust-builder LXC (10.10.0.233), install the shared client token on each NixOS machine and rebuild:

sudo install -d -m 0750 -o root /etc/sccache
ssh root@10.10.0.233 "awk -F ' = ' '/^token = / { gsub(/\"/, \"\", \$2); print \$2; exit }' /etc/sccache/client.conf" \
  | sudo install -m 0600 -o root /dev/stdin /etc/sccache/client-token
sudo nixos-rebuild switch --flake ~/nixos-config#$(hostname)

After rebuilding, new shells use:

RUSTC_WRAPPER=sccache
SCCACHE_CONF=/etc/sccache/client.conf
CARGO_INCREMENTAL=0

Verify from a project with:

sccache --dist-status
sccache --zero-stats
cargo clean && cargo build
sccache --show-stats | grep -A2 "Successful distributed compiles"

Updating the System

Run Forge to update flake inputs, rebuild, and update CLI tools:

nix run github:DigitalPals/nixos-config#forge -- update

Or if you have the config cloned locally:

nix run .#forge -- update

This will:

  1. Update all flake inputs (nix flake update)
  2. Rebuild the system if there are changes
  3. Update Claude Code and Codex CLI
  4. Check browser profile sync status

Configuration Structure

nixos-config/
├── flake.nix                 # Main flake with host configurations
├── flake.lock                # Locked dependencies
├── hosts/
│   ├── kraken/               # Desktop configuration (AMD)
│   │   ├── default.nix
│   │   └── hardware-configuration.nix
│   ├── thebeast/             # Threadripper workstation (AMD)
│   │   ├── default.nix
│   │   └── hardware-configuration.nix
│   ├── G1a/                  # HP ZBook Ultra G1a (AMD)
│   │   ├── default.nix
│   │   └── hardware-configuration.nix
│   ├── z2-mini-g1a/          # HP Z2 Mini G1a (AMD)
│   │   ├── default.nix
│   │   └── hardware-configuration.nix
│   ├── proart/               # ASUS ProArt P16 OLED
│   │   ├── default.nix
│   │   └── hardware-configuration.nix
│   └── xps/                  # Dell XPS 14
│       ├── default.nix
│       └── hardware-configuration.nix
├── modules/
│   ├── common.nix            # Shared system configuration
│   ├── desktop-environments.nix
│   ├── disko/                # Disk partitioning
│   │   ├── default.nix       # Common disko config
│   │   ├── kraken.nix        # Kraken disk device
│   │   ├── thebeast.nix      # Thebeast disk device
│   │   ├── G1a.nix           # G1a disk device
│   │   ├── z2-mini-g1a.nix   # HP Z2 Mini G1a disk device
│   │   ├── proart.nix        # ProArt disk device (LVM for hibernate)
│   │   └── xps.nix           # XPS disk device
│   ├── boot/
│   │   └── limine-plymouth.nix
│   └── hardware/
│       ├── amd.nix
│       └── nvidia.nix
├── home/                     # Home Manager configuration
│   ├── home.nix              # Main config
│   ├── ghostty.nix           # Terminal configuration
│   ├── hyprland/             # Hyprland window manager config
│   │   ├── autostart.nix
│   │   └── bindings.nix
│   └── shells/
│       ├── common/           # Shared shell, prompt, and theme config
│       └── lumen/            # Lumen Desktop Shell config
└── packages/
    ├── forge/                # TUI installer and system management tool
    ├── plymouth-cybex/       # Custom Plymouth theme
    └── hyprland-sessions/    # Session .desktop files

Troubleshooting

No network on first boot

NetworkManager should work automatically. If not:

nmtui

Forgot LUKS passphrase

There is no recovery option. You'll need to reinstall.

Change disk device after installation

Edit modules/disko/<hostname>.nix and update the device path, then reinstall.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages