Skip to content
lavigneerPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

396 Commits

Folders and files

Repository files navigation

Nix Configuration

A clean, modular Nix configuration supporting both NixOS and nix-darwin with Home Manager integration.

🏗️ Architecture

This configuration uses a layered architecture with shared components and platform-specific overrides:

nix-rework/
├── flake.nix                    # Main flake entry point
├── shared/                      # Cross-platform components
├── linux/                      # Linux/NixOS specific
├── darwin/                      # macOS/nix-darwin specific
└── systems/                     # Machine-specific configs

📁 Directory Structure

shared/ - Cross-platform Components

shared/
├── home-manager/               # User-level configs
│   ├── cli-tools.nix          # CLI utilities (fzf, ripgrep, direnv, yazi)
│   ├── development.nix        # Programming languages & tools
│   ├── git.nix               # Git configuration
│   ├── nixvim/               # Nixvim configuration directory
│   │   ├── default.nix       # Main nixvim configuration
│   │   ├── keymaps.nix       # Key mappings
│   │   └── plugins.nix       # Plugin configurations
│   ├── zsh.nix               # Zsh with oh-my-zsh and starship
│   ├── herdr-desktop/        # Herdr desktop app: settings, keys, projects/tickets/work mods
│   ├── claude.nix            # Claude Code, plus the sheltie skills
│   ├── terminals.nix         # Terminal emulators (ghostty)
│   ├── zed.nix               # Zed editor
│   ├── browser.nix           # Web browser (Chrome)
│   ├── discord.nix           # Discord
│   ├── docker.nix            # Docker tools (lazydocker)
│   ├── thunderbird.nix       # Email client
│   └── core.nix              # Basic Home Manager setup
└── system/                    # System-level configs
    ├── nix.nix               # Core Nix settings
    ├── fonts.nix             # Font packages
    ├── shell.nix             # System shell config
    └── stylix.nix            # Theming with Stylix

linux/ - Linux Platform

linux/
├── default.nix               # Linux platform defaults
└── modules/
    ├── system/               # System-level Linux configs
    │   ├── gaming.nix       # Steam and gaming setup
    │   ├── status-bar.nix   # i3status-rust bar (shared by i3 and Sway)
    │   └── rofi.nix         # Application launcher (shared)
    ├── programs/             # User programs (Linux-specific)
    │   ├── desktop-apps.nix # Desktop applications
    │   └── gaming.nix       # User gaming tools (lutris)
    └── window-managers/      # Window manager configs
        ├── wayland.nix      # Wayland ecosystem (grim, slurp, wl-clipboard)
        ├── x11.nix          # X11 ecosystem (dunst, feh, xss-lock)
        ├── tiling-common.nix # Settings shared by i3 and Sway (keys, focus, startup deps)
        ├── i3.nix           # i3 window manager
        └── sway.nix         # Sway compositor

darwin/ - macOS Platform

darwin/
├── default.nix               # macOS platform defaults
└── modules/
    ├── programs/
    │   └── karabiner.nix     # Karabiner-Elements key remapping
    └── window-managers/
        └── aerospace.nix     # AeroSpace tiling window manager

systems/ - Machine-specific Configurations

systems/
├── nixos/                    # Linux machine config
│   ├── default.nix         # NixOS system configuration
│   └── hardware-configuration.nix
└── mac/                      # macOS machine config
    └── default.nix          # nix-darwin system configuration

🎯 Key Features

Modular Design

  • Shared components for cross-platform consistency
  • Platform-specific modules for Linux and macOS differences
  • Machine-specific overrides for personal preferences

Window Manager Support

  • Linux: i3 (X11), Sway (Wayland)
  • macOS: AeroSpace tiling window manager
  • Unified tools: Rofi launcher and i3status-rust status bar across all WMs

Development Environment

  • Languages: Rust, Go, Node.js, Nix
  • Editors: Neovim (with LSPs), Zed Editor
  • Tools: Git, Docker, CLI utilities

Clean Architecture

  • DRY principle: No code duplication
  • Layered imports: Platform defaults → Machine overrides
  • Consistent formatting: Clean, readable configuration

🚀 Usage

Build NixOS System

sudo nixos-rebuild switch --flake ~/workspace/dotfile#nixos

Build macOS System

darwin-rebuild switch --flake ~/workspace/dotfiles#mac

Development Shell

nix develop

🔧 Configuration

Adding New Programs

  1. Cross-platform: Add to shared/home-manager/
  2. Linux-specific: Add to linux/modules/programs/
  3. macOS-specific: Add to darwin/modules/programs/

Adding New Window Managers

  1. Create new file in linux/modules/window-managers/
  2. Import appropriate base module (wayland.nix or x11.nix)
  3. For i3-style WMs, import ./tiling-common.nix (brings in the shared bar and rofi) and use config.windowManagers.tiling / config.windowManagers.statusBar
  4. Add to system imports in systems/nixos/default.nix

Customizing Per Machine

  • Edit files in systems/*/default.nix
  • Override platform defaults using higher priority
  • Add machine-specific Home Manager module imports

📋 System Requirements

  • NixOS: 25.05 or later
  • nix-darwin: Compatible version
  • Home Manager: Latest stable
  • Flakes: Enabled (experimental-features = nix-command flakes)

🎨 Theming

The configuration uses Stylix for consistent theming across:

  • Terminal applications
  • Desktop environments
  • Development tools

Theme is configured in shared/system/stylix.nix and enabled for both platforms.

🔄 Updates

To update all inputs:

nix flake update

To update specific input:

nix flake lock --update-input nixpkgs

FireConnect Claude Setup

The M-DX000XV19K Mac configuration installs the pinned FireConnect setup gist as setup-fireconnect. Run it after applying the configuration to perform the interactive Fireworks login and configure Claude:

setup-fireconnect

📝 Notes

  • Email configuration is machine-specific (personal vs work)
  • Gaming setup is Linux-only
  • Status bar is i3bar/swaybar driven by one shared i3status-rust config
  • Rofi 2.0.0+ has native Wayland support
  • Configuration files are symlinked from dotfiles directory

Ticket workflow (herdr-desktop)

The tickets popup (Ctrl+B t), Work sidebar, projects picker (Ctrl+B f), the Claude skills (/draft-pr, /address-comments, /fix-ci, /resolve-conflicts), the sheltie layout and herdr-demo come from sheltie, a flake input. shared/home-manager/herdr-desktop installs its mods and writes their settings (~/.config/herdr-app/sheltie.json) from the herdrDesktop.tickets options; that repo's README documents the workflow. rebuild-nix fetches the (private) input as you before the root rebuild.

🤝 Contributing

This is a personal configuration, but feel free to use it as inspiration for your own setup. The modular architecture makes it easy to adapt to different needs.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages