Skip to content

jcspeegs/configs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

271 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—๏ธ NixOS Configuration Flake

๐ŸŽฏ Declarative, reproducible system configurations for all my machines

NixOS Built with Flakes Home Manager


๐Ÿ“– Overview

This repository contains my complete NixOS system configurations managed using Nix Flakes. It provides a fully declarative, version-controlled setup for multiple machines with consistent environments across desktop, development, and security research workflows.

โœจ Why This Approach?

  • ๐Ÿ”’ Reproducible: Exact same system state across machines
  • ๐Ÿ“ฆ Version Controlled: All configs in git with full history
  • ๐Ÿ”„ Atomic Updates: Rollback to previous generations instantly
  • ๐Ÿงฉ Modular: Reusable components for easy customization
  • ๐Ÿ  Home Manager: Dotfiles and user configs declaratively managed

๐Ÿ–ฅ๏ธ Managed Systems

Machine Type Description
๐ŸŒŸ lightshow Desktop High-performance workstation with NVIDIA GPU support
๐Ÿฑ tabby Laptop Mobile setup with high-DPI display and touchpad optimization

๐Ÿ›๏ธ Architecture

graph TB
    A[๐ŸŽฏ flake.nix] --> B[โš™๏ธ configuration.nix]
    B --> C[๐Ÿ“ฆ packages/*]
    B --> D[๐Ÿ”ง overlays/]
    A --> E[๐ŸŒŸ lightshow/]
    A --> F[๐Ÿฑ tabby/]

    C --> C1[๐ŸŽจ Desktop: GNOME]
    C --> C2[๐Ÿš Shells: Fish + Bash]
    C --> C3[โšก Dev Tools]
    C --> C4[๐Ÿ” Security Tools]
    C --> C5[๐ŸŽฎ Gaming: Steam]

    E --> E1[๐ŸŽฎ NVIDIA Drivers]
    E --> E2[๐Ÿ“ก WiFi Adapter]

    F --> F1[๐Ÿ–ฅ๏ธ HiDPI: 130 DPI]
    F --> F2[๐Ÿ‘† Touchpad Config]

    B --> H[๐Ÿ  home-manager]
    H --> H1[๐Ÿ‘ค ugflows]
    H --> H2[๐Ÿ‘ค jesse]
    H --> H3[๐Ÿ‘ค jensen]
    H --> H4[๐Ÿ‘ค lauren]

    style A fill:#5277C3
    style B fill:#7EBAE4
    style C fill:#B4E7CE
    style H fill:#FFD4A3
Loading

๐Ÿ“‚ Repository Structure

.
โ”œโ”€โ”€ ๐ŸŽฏ flake.nix                    # Flake entry point & dependency management
โ”œโ”€โ”€ โš™๏ธ configuration.nix            # Shared base configuration
โ”œโ”€โ”€ ๐Ÿ”’ flake.lock                  # Locked dependency versions
โ”‚
โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ Machine Configurations
โ”‚   โ”œโ”€โ”€ lightshow/
โ”‚   โ”‚   โ”œโ”€โ”€ lightshow.nix
โ”‚   โ”‚   โ””โ”€โ”€ hardware-configuration.nix
โ”‚   โ””โ”€โ”€ tabby/
โ”‚       โ”œโ”€โ”€ tabby.nix
โ”‚       โ””โ”€โ”€ hardware-configuration.nix
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ฆ packages/                   # Modular configuration components
โ”‚   โ”œโ”€โ”€ systemPackages.nix        # System-wide package list
โ”‚   โ”œโ”€โ”€ users.nix                 # User accounts & home-manager
โ”‚   โ”œโ”€โ”€ gnome.nix                 # GNOME desktop environment
โ”‚   โ”œโ”€โ”€ vim.nix                   # Vim with Python dev setup
โ”‚   โ”œโ”€โ”€ tmux.nix                  # Tmux configuration
โ”‚   โ”œโ”€โ”€ bash.nix                  # Bash shell
โ”‚   โ”œโ”€โ”€ fish/                     # Fish shell (default)
โ”‚   โ”œโ”€โ”€ scripts.nix               # Custom scripts overlay
โ”‚   โ”œโ”€โ”€ steam.nix                 # Gaming platform
โ”‚   โ”œโ”€โ”€ qtile/                    # Alternative window manager
โ”‚   โ”œโ”€โ”€ rofi/                     # Application launcher
โ”‚   โ””โ”€โ”€ git/                      # Git configuration
โ”‚
โ””โ”€โ”€ ๐Ÿ”ง overlays/                  # Package customizations
    โ””โ”€โ”€ default.nix               # i3ipc, lastpass-cli fixes

๐ŸŽจ Feature Highlights

๐Ÿ–ฅ๏ธ Desktop Environment

  • Primary: GNOME Desktop with GDM
  • Alternative: Qtile tiling window manager (optional)
  • Launcher: Rofi with custom themes
  • Fonts: Nerd Fonts (FiraCode, Hack) for icon support

๐Ÿš Shell Environment

flowchart LR
    A[๐Ÿš€ Login] --> B{Shell?}
    B -->|Default| C[๐ŸŸ Fish Shell]
    B -->|Fallback| D[๐Ÿš Bash]

    C --> E[โญ Starship Prompt]
    C --> F[๐Ÿ” FZF Integration]
    C --> G[โŒจ๏ธ Vi Keybindings]

    D --> H[โšก Powerline]

    style C fill:#A8E6CF
    style E fill:#FFD4A3
Loading

Features:

  • ๐ŸŸ Fish Shell: Modern shell with auto-suggestions
  • โญ Starship: Beautiful, fast prompt
  • ๐Ÿ” FZF: Fuzzy finder with bat preview
  • โŒจ๏ธ Vi Mode: Vim-style editing in shell
  • ๐Ÿ“ Custom Aliases: Optimized workflows

โšก Development Tools

๐Ÿ Python Development

  • Editor: Vim with jedi-vim, ALE, flake8, black, isort
  • Tools: Full Python 3 stack with development packages

โ˜ธ๏ธ Cloud & DevOps

  • kubectl, helm, argocd, kubeseal
  • Docker and Kubernetes tooling
  • Tailscale VPN

๐Ÿ› ๏ธ Modern CLI Tools

  • Search: ripgrep, fd, fzf
  • Display: bat, eza, glow
  • Dev: direnv, devenv, gh
  • AI: claude-code
  • Terminal: tmux, ttyd, vhs (terminal recording)

๐Ÿ” Security & Pentesting

Network Analysis:

  • nmap, tshark, kismet, wavemon
  • aircrack-ng, wifite2, airgeddon

Web Security:

  • burpsuite, nikto, sqlmap, wpscan
  • hydra, metasploit

๐ŸŽฎ Gaming & Media

  • ๐ŸŽฎ Steam: With remote play enabled
  • ๐ŸŽฌ Video: obs-studio, kdenlive, mpv
  • ๐ŸŽจ Creative: GIMP, Inkscape
  • ๐ŸŽต Music: Pianobar, Pithos, Plex
  • ๐Ÿ“บ Streaming: Video editing and production tools

๐ŸŒ Applications

Browsers:

  • Firefox, Google Chrome, Tor Browser

Communication:

  • Discord, Telegram, Mailspring

Productivity:

  • VS Code, LibreOffice suite
  • Various system utilities

๐Ÿš€ Quick Start

Prerequisites

  • NixOS installed on your system
  • Git installed
  • Flakes enabled in your Nix configuration

Initial Setup

# Clone the repository
git clone https://github.com/yourusername/configs.git ~/projects/configs
cd ~/projects/configs

# Initialize git submodules (for rofi themes)
git submodule update --init --recursive

# Build and switch to the configuration
sudo nixos-rebuild switch --flake .#<hostname>

Replace <hostname> with either lightshow or tabby.


๐Ÿ”„ Update Workflow

flowchart TD
    A[๐Ÿ“ Make Changes] --> B{Update Type?}

    B -->|Config Only| C[๐Ÿ”ง Edit .nix files]
    B -->|Dependencies| D[๐Ÿ”„ Update flake.lock]

    C --> E[๐Ÿงช Test Build]
    D --> E

    E --> F{Build Success?}
    F -->|โŒ No| G[๐Ÿ” Fix Errors]
    F -->|โœ… Yes| H[๐Ÿš€ Apply Changes]

    G --> E

    H --> I{Apply Method?}
    I -->|Test Only| J[nupt: Test without switching]
    I -->|Apply Now| K[nupd: Rebuild & switch]
    I -->|Full Update| L[nupdf: Update deps + rebuild]

    J --> M[โœ… Review Changes]
    K --> M
    L --> M

    M --> N{Satisfied?}
    N -->|โœ… Yes| O[๐ŸŽ‰ Done!]
    N -->|โŒ No| P[โฎ๏ธ Rollback]

    P --> Q[Select previous generation]
    Q --> O

    style A fill:#A8E6CF
    style H fill:#FFD4A3
    style O fill:#B4E7CE
    style P fill:#FF9AA2
Loading

Update Commands

These convenient aliases are available after installation:

# Test configuration without switching
nupt

# Rebuild and switch to new configuration
nupd

# Update flake.lock, then rebuild (full update)
nupdf

Manual Commands

# Test build without switching
sudo nixos-rebuild test --flake .#<hostname>

# Build and switch
sudo nixos-rebuild switch --flake .#<hostname>

# Update flake inputs
nix flake update

# Update specific input
nix flake lock --update-input nixpkgs

๐Ÿ‘ฅ User Management

The configuration manages 4 user accounts:

User Full Name Groups Role
๐Ÿง‘โ€๐Ÿ’ป ugflows Justin Speegle wheel, networkmanager Primary admin
๐Ÿ‘ค jesse - networkmanager Family member
๐Ÿ‘ค jensen - networkmanager Family member
๐Ÿ‘ค lauren - networkmanager Family member

All users are configured with:

  • Initial hashed passwords
  • NetworkManager access
  • Home-manager integration for dotfiles

๐Ÿ”ง Customization Guide

Adding a New Machine

  1. Create a new directory for your machine:

    mkdir my-machine
  2. Generate hardware configuration:

    sudo nixos-generate-config --show-hardware-config > my-machine/hardware-configuration.nix
  3. Create machine-specific config my-machine/my-machine.nix:

    { config, pkgs, ... }:
    {
      imports = [ ./hardware-configuration.nix ];
    
      networking.hostName = "my-machine";
    
      # Add machine-specific settings here
    }
  4. Add to flake.nix:

    nixosConfigurations = {
      lightshow = myMachine ./lightshow/lightshow.nix;
      tabby = myMachine ./tabby/tabby.nix;
      my-machine = myMachine ./my-machine/my-machine.nix;  # Add this line
    };

Adding New Packages

Edit packages/systemPackages.nix and add to the appropriate category:

environment.systemPackages = with pkgs; [
  # Add your packages here
  my-new-package
];

Creating Custom Modules

  1. Create a new file in packages/:

    touch packages/my-feature.nix
  2. Add your configuration:

    { config, pkgs, ... }:
    {
      # Your custom configuration
    }
  3. Import in configuration.nix:

    imports = [
      # ... existing imports
      ./packages/my-feature.nix
    ];

๐Ÿงฉ Key Components Deep Dive

Flake Inputs

graph LR
    A[๐Ÿ“ฆ flake.nix] --> B[nixpkgs/nixos-unstable]
    A --> C[nixpkgs/nixos-24.05]
    A --> D[home-manager]
    A --> E[github:jcspeegs/scripts]

    B --> F[Latest Packages]
    C --> G[Stable Fallback]
    D --> H[User Environments]
    E --> I[Custom Scripts]

    style A fill:#5277C3
    style F fill:#A8E6CF
    style H fill:#FFD4A3
Loading

System Services

The configuration enables these system services:

  • ๐Ÿ” mlocate: File indexing (hourly updates)
  • ๐Ÿ” Tailscale: VPN mesh networking
  • ๐Ÿ–จ๏ธ CUPS: Printing with Epson drivers
  • ๐ŸŽต PipeWire: Modern audio system
  • ๐Ÿ—‚๏ธ GVFS: Virtual filesystem for Nautilus
  • ๐Ÿ“š Man Pages: Comprehensive documentation

Boot Configuration

  • Bootloader: systemd-boot with EFI support
  • Kernel: Latest Linux kernel (linuxPackages_latest)
  • Graphics: Hardware acceleration enabled

๐Ÿ› Troubleshooting

Build Fails

# Clean build cache
nix-collect-garbage -d

# Retry with verbose output
sudo nixos-rebuild switch --flake .#<hostname> --show-trace

Rollback to Previous Generation

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

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

# Or boot into previous generation from bootloader menu

Update Git Submodules

git submodule update --init --recursive

Check Flake Status

# Show flake metadata
nix flake metadata

# Show flake outputs
nix flake show

๐Ÿ“š Resources


๐Ÿค Contributing

This is a personal configuration repository, but feel free to:

  • ๐ŸŒŸ Use it as inspiration for your own configs
  • ๐Ÿ› Report issues or suggest improvements
  • ๐Ÿ”€ Fork and adapt for your needs

๐Ÿ“ License

This configuration is provided as-is for personal use. Feel free to use, modify, and distribute as you see fit.


๐Ÿ™ Acknowledgments

  • ๐ŸŽฏ NixOS Community: For the amazing ecosystem
  • ๐Ÿ  Home Manager: For declarative dotfile management
  • ๐ŸŒŸ Starship: For the beautiful prompt
  • ๐ŸŸ Fish Shell: For the modern shell experience

Made with โ„๏ธ by Justin Speegle

Powered by NixOS, the purely functional Linux distribution

About

Config files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors