# My Nix Configurations πŸ’» My modular Nix configsπŸ”₯ ## Requirements βš™οΈ - [Nix 2.0 & Flakes enabled](https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS) ### NixOS Configurations - [NixOS](https://www.nixos.org/) ### Home-Manager Configuration - [Nix Home-Manager](https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-standalone) # Flake End-Points Exposed ❄️ NixOS Configurations: - desktop - wsl - server (wip) - vm Home-Manager Configurations: - workstation Fork this repo, take inspiration, borrow ideas and create your own NixOS configs & modules ## Developing & Customizing πŸ”§ If you need a list of available packages and options: - [nixpkgs Packages](https://search.nixos.org/packages) πŸ“¦οΈ - [nixpkgs Options](https://search.nixos.org/options?) πŸ”οΈ - [Home-Manager Options](https://mipmip.github.io/home-manager-option-search/) β˜•οΈ Invoke `nix develop` to enter a development shell powered by [`just`](https://github.com/casey/just) Invoke `just` in order to view an available list of project scripts `user.configs.nix` is a symlink to conveniently access centrally defined common user variables from the repo root ⚠️ Be sure to tailor any hardware settings to your own ⚠️ Replace the `hardware.nix` found in the `src/system/machines/` directory ⚠️ Run `nixos-generate-config` to generate a `hardware-configuration.nix` for your current system ## Submodules This repo uses git submodules for portable cross-platform configurations. ### Neovim Config The Neovim configuration is a separate repo for portability across non-NixOS systems. **Location:** `src/user/modules/utils/modules/neovim/config/nvim` **Repo:** [github.com/itme-brain/nvim](https://github.com/itme-brain/nvim) #### Cloning with submodules ```bash git clone --recurse-submodules git@github.com:itme-brain/nixos.git # Or after cloning: git submodule update --init ``` #### Updating nvim config ```bash # Edit files in the submodule, then: cd src/user/modules/utils/modules/neovim/config/nvim git add . && git commit -m "your changes" && git push # Update reference in nixos repo: git add src/user/modules/utils/modules/neovim/config/nvim git commit -m "Update nvim submodule" && git push ``` #### Pulling nvim updates from remote ```bash git submodule update --remote git add src/user/modules/utils/modules/neovim/config/nvim git commit -m "Update nvim submodule" && git push ``` #### Standalone nvim install (non-NixOS) ```bash git clone git@github.com:itme-brain/nvim.git ~/.config/nvim ``` ## Directory Structure ``` . β”œβ”€β”€ flake.nix # Flake entrypoint - defines all NixOS configurations β”œβ”€β”€ flake.lock β”œβ”€β”€ justfile # Project scripts (via `just`) β”œβ”€β”€ system.configs -> src/system/machines/ # Symlink for quick access β”œβ”€β”€ user.configs -> src/user/config/ # Symlink for quick access └── src/ β”œβ”€β”€ system/ # System-level (NixOS) configuration β”‚ β”œβ”€β”€ machines/ # Per-machine NixOS configurations β”‚ β”‚ β”œβ”€β”€ desktop/ # Desktop config (flake: nixosConfigurations.desktop) β”‚ β”‚ β”‚ β”œβ”€β”€ default.nix # Machine entry point β”‚ β”‚ β”‚ β”œβ”€β”€ hardware.nix # Machine-specific hardware config β”‚ β”‚ β”‚ β”œβ”€β”€ system.nix # System-level settings β”‚ β”‚ β”‚ └── modules/ β”‚ β”‚ β”‚ β”œβ”€β”€ disko/ # Disk partitioning (disko) β”‚ β”‚ β”‚ └── home-manager/ # Home-manager integration + home.nix β”‚ β”‚ β”œβ”€β”€ workstation/ # Workstation config (same structure as desktop) β”‚ β”‚ β”œβ”€β”€ server/ # Server config (no disko) β”‚ β”‚ β”œβ”€β”€ vm/ # VM config β”‚ β”‚ β”œβ”€β”€ wsl/ # WSL config (includes wsl module) β”‚ β”‚ └── laptop/ # Laptop config (stub) β”‚ └── modules/ # Shared system modules (imported by machines) β”‚ β”œβ”€β”€ default.nix β”‚ β”œβ”€β”€ bitcoin/ # Bitcoin node + electrum server β”‚ β”œβ”€β”€ forgejo/ # Self-hosted Forgejo β”‚ └── nginx/ # Nginx reverse proxy β”‚ └── user/ # User-level (home-manager) configuration β”œβ”€β”€ default.nix # User module entry point β”œβ”€β”€ config/ # User identity & settings β”‚ β”œβ”€β”€ default.nix # Common user variables (username, email, etc.) β”‚ β”œβ”€β”€ bookmarks/ # Browser bookmarks β”‚ β”œβ”€β”€ keys/ # Public keys β”‚ β”‚ β”œβ”€β”€ pgp/ # PGP public keys β”‚ β”‚ └── ssh/ # SSH public keys β”‚ └── nvim # Symlink to neovim submodule config └── modules/ # Home-manager modules β”œβ”€β”€ bash/ # Shell config (aliases, prompt, bashrc) β”œβ”€β”€ git/ # Git config + helper scripts β”œβ”€β”€ tmux/ # Tmux config β”œβ”€β”€ security/ # Security tools (GPG) β”œβ”€β”€ utils/ # CLI utilities β”‚ └── modules/ β”‚ β”œβ”€β”€ dev/ # Dev tools (penpot, PCB design) β”‚ β”œβ”€β”€ email/ # Email client (aerc) β”‚ β”œβ”€β”€ irc/ # IRC client β”‚ β”œβ”€β”€ neovim/ # Neovim (config is a git submodule) β”‚ └── vim/ # Vim fallback └── gui/ # GUI applications β”œβ”€β”€ modules/ β”‚ β”œβ”€β”€ alacritty/ # Terminal emulator β”‚ β”œβ”€β”€ browsers/ # Firefox & Chromium β”‚ β”œβ”€β”€ corn/ # Corn app β”‚ β”œβ”€β”€ fun/ # Discord, etc. β”‚ β”œβ”€β”€ utils/ # GUI utilities β”‚ └── writing/ # Writing tools └── wm/ # Window managers β”œβ”€β”€ hyprland/ # Hyprland (Wayland) + waybar, rofi β”œβ”€β”€ sway/ # Sway (Wayland) + rofi β”œβ”€β”€ i3/ # i3 (X11) + rofi └── shared/ # Shared WM config (mimeapps) ``` ### How it works The **flake.nix** is the entrypoint. It defines NixOS configurations (desktop, workstation, server, wsl) that each reference a machine under `src/system/machines/`. Each machine's `default.nix` pulls in its own `hardware.nix`, `system.nix`, and per-machine modules (disko, home-manager). The **system layer** (`src/system/`) handles NixOS-level concerns: hardware, bootloader, networking, and system services. Shared system-level modules in `src/system/modules/` can be imported by any machine. The **user layer** (`src/user/`) handles home-manager configuration. `src/user/config/` defines user identity (name, email, keys), while `src/user/modules/` contains modular home-manager configs for individual tools. Each machine's `home-manager/home.nix` selects which user modules to enable. Root symlinks `system.configs` and `user.configs` provide convenient access to machine definitions and user config from the repo root.