A clean, modular Nix configuration supporting both NixOS and nix-darwin with Home Manager integration.
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
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
β βββ tmux.nix # Tmux configuration
β βββ 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/
βββ default.nix # Linux platform defaults
βββ modules/
βββ system/ # System-level Linux configs
β βββ gaming.nix # Steam and gaming setup
β βββ polybar.nix # Status bar (shared across WMs)
β βββ 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 (mako, grim, slurp)
βββ x11.nix # X11 ecosystem (dunst, feh, xss-lock)
βββ i3.nix # i3 window manager
βββ sway.nix # Sway compositor
βββ hyprland.nix # Hyprland compositor
darwin/
βββ default.nix # macOS platform defaults
βββ modules/
βββ programs/
β βββ karabiner.nix # Karabiner-Elements key remapping
βββ window-managers/
βββ aerospace.nix # AeroSpace tiling window manager
systems/
βββ nixos/ # Linux machine config
β βββ default.nix # NixOS system configuration
β βββ hardware-configuration.nix
βββ mac/ # macOS machine config
βββ default.nix # nix-darwin system configuration
- Shared components for cross-platform consistency
- Platform-specific modules for Linux and macOS differences
- Machine-specific overrides for personal preferences
- Linux: i3 (X11), Sway (Wayland), Hyprland (Wayland)
- macOS: AeroSpace tiling window manager
- Unified tools: Rofi launcher and Polybar status bar across all WMs
- Languages: Rust, Go, Node.js, Nix
- Editors: Neovim (with LSPs), Zed Editor
- Tools: Git, Docker, CLI utilities
- DRY principle: No code duplication
- Layered imports: Platform defaults β Machine overrides
- Consistent formatting: Clean, readable configuration
sudo nixos-rebuild switch --flake ~/workspace/dotfile#nixosdarwin-rebuild switch --flake ~/workspace/dotfiles#macnix develop- Cross-platform: Add to
shared/home-manager/ - Linux-specific: Add to
linux/modules/programs/ - macOS-specific: Add to
darwin/modules/programs/
- Create new file in
linux/modules/window-managers/ - Import appropriate base module (
wayland.nixorx11.nix) - Import shared components (
../system/polybar.nix,../system/rofi.nix) - Add to system imports in
systems/nixos/default.nix
- Edit files in
systems/*/default.nix - Override platform defaults using higher priority
- Add machine-specific Home Manager module imports
- NixOS: 25.05 or later
- nix-darwin: Compatible version
- Home Manager: Latest stable
- Flakes: Enabled (
experimental-features = nix-command flakes)
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.
To update all inputs:
nix flake updateTo update specific input:
nix flake lock --update-input nixpkgs- Email configuration is machine-specific (personal vs work)
- Gaming setup is Linux-only
- Polybar works on Wayland via XWayland
- Rofi 2.0.0+ has native Wayland support
- Configuration files are symlinked from dotfiles directory
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.