# My Nix Configurations ๐Ÿ’ป My modular Nix configs ๐Ÿ”ฅ ## Requirements โš™๏ธ - [Nix 2.0 & Flakes enabled](https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS) - [NixOS](https://www.nixos.org/) for system configurations - [Nix Home-Manager](https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-standalone) for user configurations ## Flake Endpoints โ„๏ธ NixOS Configurations: `desktop` ยท `workstation` ยท `server` (wip) ยท `vm` ยท `wsl` ## Getting Started ๐Ÿ”ง ```bash git clone --recurse-submodules git@github.com:itme-brain/nixos.git ``` Enter the dev shell with `nix develop`, then run `just` to see available project scripts. Useful resources: - [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/) โ˜•๏ธ โš ๏ธ Be sure to tailor any hardware settings to your own โ€” replace the `hardware.nix` in `src/system/machines/` with output from `nixos-generate-config` ## Submodules ๐Ÿ”— Standalone portable configurations maintained as separate repos. Each can be cloned independently on any system โ€” NixOS or not. | Submodule | Purpose | Repo | Standalone Install | |-----------|---------|------|--------------------| | **nvim** | Full IDE (LSP, treesitter, telescope) | [itme-brain/nvim](https://github.com/itme-brain/nvim) | `git clone git@github.com:itme-brain/nvim.git ~/.config/nvim` | | **vim** | Lightweight editor for headless servers | [itme-brain/vim](https://github.com/itme-brain/vim) | `git clone git@github.com:itme-brain/vim.git ~/.vim` | ```bash # Update a submodule cd git add . && git commit -m "your changes" && git push cd /path/to/nixos git add && git commit -m "Update submodule" # Pull submodule updates from remote git submodule update --remote git add && git commit -m "Update submodule" ``` ## 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 โ”‚ โ””โ”€โ”€ vim # Symlink to vim 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 lightweight (config is a git submodule) โ””โ”€โ”€ 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 **flake.nix** 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 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 quick access to machine definitions and user config from the repo root.