Skip to content

Repository files navigation

NixOS Configuration

Personal NixOS configuration using flakes for declarative system management.

Overview

This repository contains my declarative NixOS system configuration, including:

  • Window Manager: Sway (Wayland compositor)
  • Terminal: Ghostty with JetBrains Mono
  • Shell: Zsh with Starship prompt
  • Display Manager: greetd with tuigreet
  • Development: Docker, Git, Go, Node.js, various IDEs

Repository Structure

<project-root>/
├── flake.nix                       # Flake configuration
├── flake.lock                      # Flake lock file
├── assets/images/                  # Wallpapers and images
├── data/                           # Shared data (hosts, constants, collections)
├── docs/                           # Extended documentation
├── hosts/                          # Per-host configs (configuration + hardware)
│   ├── corbelan/                   # Laptop (headed)
│   ├── nostromo/                   # Desktop (headed)
│   └── sulaco/                     # Server (headless)
├── lib/                            # Shared utility functions
├── modules/
│   ├── nixos/                      # System modules, grouped by category
│   │   ├── core/                   # boot, users, sudo, docker, xdg, greeter...
│   │   ├── system/                 # sops, gcp
│   │   ├── theme/                  # stylix
│   │   ├── network/                # networking, openssh, tailscale, mullvad
│   │   ├── hardware/               # gpu, bluetooth, fingerprint, audio...
│   │   ├── security/               # 1password, clamav, keyring
│   │   ├── desktop/                # sway
│   │   ├── gaming/                 # steam, gamemode
│   │   └── services/               # headless services (jellyfin, caddy...)
│   └── home/                       # Home Manager modules, grouped by category
│       ├── cli/                    # terminal tools (zsh, yazi, lftp...)
│       ├── dev/                    # git, go, editors
│       ├── desktop/                # sway, waybar, mako, cursor...
│       ├── apps/                   # GUI apps (chromium, vesktop)
│       ├── pim/                    # calendars, contacts
│       └── system/                 # env vars, sops, ssh, xdg, syncthing
├── profiles/                       # Aggregators selecting module sets per host
│   ├── base.nix                    # shared by every host
│   ├── headed.nix                  # desktop hosts (imports base)
│   ├── headless.nix                # servers (imports base)
│   └── home/                       # matching Home Manager profiles
├── secrets/                        # sops-encrypted secrets
├── claude/                         # Claude Code skills
└── users/
    └── gray.nix                    # User module (HM wiring + SSH keys)

Hosts import a single profile (headed/headless), which pulls in base plus its category modules; host-specific hardware is imported directly by each host.

This configuration uses flakes, so you can rebuild directly from the repository without symlinks:

# Rebuild current host (auto-detected)
sudo nixos-rebuild <option> --flake .

# Rebuild specific host
sudo nixos-rebuild <option> --flake .#<host>

Setup Instructions

Prerequisites

  1. Setup internet if necessary:
# Connect to a WiFi network
nmcli device wifi connect <ssid> password <password>
  1. Ensure flakes are enabled:
# Add to /etc/nixos/configuration.nix
nix.settings.experimental-features = [ "nix-command" "flakes" ];

Initial Setup

  1. Clone this repository:

    git clone https://github.com/graysonlee123/nixos
    cd nixos
  2. Build and activate the configuration:

    # For current host (auto-detected)
    sudo nixos-rebuild switch --flake .
    
    # Or specify a host
    sudo nixos-rebuild switch --flake .#corbelan
    sudo nixos-rebuild switch --flake .#nostromo

Tailscale

If you want to connect to your Tailscale network, you'll have to create a key and authenticate:

sudo tailscale up --auth-key=KEY

System Configuration Highlights

System Packages

  • curl, inxi
  • ClamAV (antivirus)
  • Fonts: Agave Nerd Font, Lora, Work Sans (via Stylix)

User Packages (via Home Manager)

  • Productivity: 1Password, Obsidian, Discord
  • Development: Claude Code, VS Code, PhpStorm, Docker, Git
  • Languages: Go (with gopls), Node.js 24, PHP 8.2 (with Composer)
  • Browsers: Chromium (with WideVine)
  • File Management: FileZilla, Yazi
  • System Monitoring: btop, dust, dive
  • Database Tools: pgcli, mycli, pgadmin4 (desktop mode)
  • Git Tools: lazygit, git-crypt
  • Docker Tools: lazydocker
  • Terminal Tools: vim, fzf, ripgrep, tealdeer, zoxide
  • Utilities: wl-clipboard, wp-cli, rclone, restic, satty (screenshots)
  • Media: vlc, wf-recorder
  • Entertainment: 2048-in-terminal, asciiquarium, crawl, nethack
  • Other: tree, zip/unzip, jq, nixfmt, dig, speedtest-cli, pnpm

Audio

See docs/audio.md.

ClamAV

Virus signatures auto-updated via services.clamav.updater. Run a manual scan monthly:

clamscan -r --bell -i /home/gray

Syncthing

See docs/syncthing.md.

Services

  • OpenSSH daemon
  • Docker daemon
  • NetworkManager

Sway Configuration

  • Modifier: Super/Windows key (Mod4)
  • Terminal: Ghostty
  • App Launcher: Vicinae (Mod+d)
  • Status Bar: Waybar
  • Custom keybindings for window management and workspaces

Terminal Setup

  • Font: JetBrains Mono Nerd Font
  • Theme: Rose Pine Moon
  • Shell: Zsh with Starship prompt

Git Configuration

See docs/git.md.

Zoxide - Smart Directory Navigation

Zoxide tracks your most used directories and lets you jump to them quickly:

  • z <pattern> - Jump to the highest-ranked directory matching the pattern
  • zi <pattern> - Interactive selection when multiple directories match
  • zoxide query <pattern> - Show which directory would be selected without jumping

Example: After visiting /home/gray/repos/me/nixos a few times, you can jump there with just z nix.

Declarative Bookmark Management

Chromium bookmarks are managed declaratively through lib/bookmarks.nix (data, git-crypt encrypted) and lib/mkChromiumBookmarks.nix (utility), which provides:

  • Separate profiles: Personal and work bookmarks in different Chromium profiles
  • Read-only enforcement: Bookmarks can only be changed via Nix configuration
  • Version controlled: All bookmarks tracked in git
  • Encrypted: Bookmark contents encrypted using git-crypt

How it works:

  1. mkBookmark: Creates a single bookmark in Chromium's format
  2. mkFolder: Creates a bookmark folder that can contain bookmarks/folders
  3. convertBookmark: Recursively converts simple bookmark definitions to Chromium format
  4. mkChromiumBookmarks: Generates the complete Chromium bookmarks JSON file

Host-Specific Configurations

See docs/hosts.md.

VPN

See docs/vpn.md.

Useful Commands

# Rebuild and switch to new configuration
sudo nixos-rebuild switch --flake .

# Test configuration without making it default
sudo nixos-rebuild test --flake .

# Check for syntax errors
sudo nixos-rebuild build --flake .

# Rollback to previous generation
sudo nixos-rebuild switch --rollback

# List all generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system

# Clean up old generations
sudo nix-collect-garbage -d

# Update flake inputs
nix flake update

# Run formatter
nix format

Useful Keybindings

  • Print: Screenshot with grim, satty and slurp
  • Super + Print: Open screen recording menu (region/fullscreen, with/without audio) via Vicinae. If a recording is already in progress, stops it immediately.

Gaming

See docs/gaming.md.

Development

See docs/development.md.

Bluetooth

Managed with bluetui (TUI). Run bluetui to scan and pair devices.

Notes

  • This configuration uses flakes and Home Manager for user-specific settings
  • Unfree packages are enabled both system-wide and for the user
  • Hardware configuration should not be manually edited (auto-generated)
  • Each host has its own configuration directory under hosts/

License

Personal configuration - use at your own risk.

About

Personal NixOS configuration using the home directory + symlinks approach for version control.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages