README.md

NixOS Configuration #

Personal NixOS configuration using Flakes, Home Manager, and flake-parts.

Structure #

nixconfig/
├── flake.nix              # Main flake entry point
├── flake-modules/         # Flake-parts modules (see flake-modules/README.md)
├── hosts/                 # Per-host configurations
│   ├── nimeses/
│   │   ├── default.nix           # NixOS system config
│   │   ├── nimeses.nix           # Home Manager config
│   │   └── hardware-configuration.nix
│   └── prometheus/
│       ├── default.nix           # NixOS system config
│       ├── prometheus.nix        # Home Manager config
│       └── hardware-configuration.nix
├── home/                  # Home Manager modules (my.user.*)
│   ├── base.nix
│   ├── desktop/
│   └── development/
├── profiles/              # NixOS system profiles (core, laptop, desktop, gaming, etc.)
├── lib/                   # Custom library functions
├── devShells/             # Development environments
├── overlays/              # Nixpkgs overlays
└── assets/                # Icons, wallpapers, themes

Installation #

First-time installation on a new machine #

  1. Clone the repository:

    git clone https://github.com/N1meses/nixconfig /etc/nixos/nixconfig
    cd /etc/nixos/nixconfig
    
  2. Generate and move hardware configuration:

    mkdir -p hosts/<hostname>
    nixos-generate-config --show-hardware-config > hosts/<hostname>/hardware-configuration.nix
    
  3. Register host in flake-modules/hosts.nix:

    hosts.<hostname> = {
      username = "your-username";
      hostname = "<hostname>";
    };
    
  4. Create host configurations:

    • hosts/<hostname>/default.nix (NixOS system config)
    • hosts/<hostname>/<hostname>.nix (Home Manager config)
  5. Uncomment host in:

    • flake-modules/nixos-configurations.nix
    • flake-modules/home-configurations.nix
  6. Rebuild with experimental features enabled:

    nixos-rebuild switch --flake .#<hostname> --extra-experimental-features "nix-command flakes"
    
  7. (Optional) Enable experimental features permanently:

    mkdir -p /etc/nix
    echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
    

    After this, future rebuilds just need:

    nixos-rebuild switch --flake .#<hostname>
    

Adding a Host #

  1. Create hosts/<hostname>/ directory with hardware-configuration.nix
  2. Register in flake-modules/hosts.nix
  3. Create default.nix (system) and <hostname>.nix (home)
  4. Uncomment in flake-modules/nixos-configurations.nix and flake-modules/home-configurations.nix
  5. Rebuild: sudo nixos-rebuild switch --flake .#<hostname>

Basic Commands #

System #

sudo nixos-rebuild switch --flake .#nimeses
sudo nixos-rebuild test --flake .#nimeses

Home Manager #

home-manager switch --flake .#nimeses

Development Shells #

nix develop .#python
nix develop .#java
nix develop .#rust
nix develop .#django

Maintenance #

nix flake update         # Update inputs
nix flake check          # Check for errors
nix flake show           # Show outputs
nix fmt                  # Format with alejandra
nix-collect-garbage -d   # Clean old generations

Module System #

Configuration uses custom namespaces:

  • my.user.* for Home Manager user configuration
  • System configuration uses profiles in profiles/ (core, laptop, desktop, gaming, server, etc.)

Compositors #

  • Hyprland - Dynamic tiling Wayland compositor
  • Niri - Scrollable-tiling Wayland compositor
  • MangoWC - Master-stack tiling Wayland compositor
  • Noctalia - Shell interface (bar, launcher, control center)

All compositors share unified configuration (monitors, appearance, keybindings) with consistent Emerald Green color scheme.

Keybindings #

  • Super + Return - Terminal
  • Super + E - File manager
  • Super + M - Launcher
  • Super + Q - Close window
  • Super + H/J/K/L - Navigate (vim-style)
  • Super + 1-9 - Switch workspace

Documentation #