diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..57610b2 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,46 @@ +# NixOS Dotfiles + +## Directory Layout + +``` +flake.nix # entry point, defines hosts +hosts/ + hivebrain/ # marvin's main machine + nikita-nixos/ # nikita's machine +home/ + packages-base.nix # universal packages every host gets (neovim, ripgrep, etc.) + programs/ # one file per installable program + fonts.nix # font config + rofi.nix # rofi config + packages + symlinks.nix # home-manager symlinks + tmux.nix # tmux config + yazi.nix # yazi config + zsh.nix # zsh config +system/ # NixOS system-level modules +``` + +## Adding a New Program + +1. Create `home/programs/.nix`: + +```nix +{ pkgs, ... }: +{ + home.packages = [ pkgs. ]; +} +``` + +The filename is the program name; the package attribute can differ (e.g. `godot.nix` uses `pkgs.godot_4`). + +2. Add the import to whichever hosts should have it in `hosts//home.nix`: + +```nix +../../home/programs/.nix +``` + +## Rules + +- `home/packages-base.nix` — shared baseline, imported by every host. Only add truly universal tools here (shell utilities, editors). +- `home/programs/` — one file per program. Hosts opt in by importing. +- `home/.nix` (tmux, zsh, rofi, etc.) — for programs that need configuration beyond just installing a package. Same opt-in pattern via host imports. +- `system/` modules are NixOS system-level config (not home-manager). Add them to `hosts//default.nix`. diff --git a/home/programs/rustup.nix b/home/programs/rustup.nix index db8aa30..57661c4 100644 --- a/home/programs/rustup.nix +++ b/home/programs/rustup.nix @@ -1,4 +1,39 @@ { pkgs, ... }: { - home.packages = [ pkgs.rustup ]; + home.packages = with pkgs; [ + rustup + sqlx-cli + openssl.dev + + # Bevy / Wayland runtime deps + wayland + wayland-protocols + libxkbcommon + libGL + vulkan-loader + alsa-lib + udev + libx11 + libxcursor + libxi + libxrandr + libxcb + ]; + + home.sessionVariables.PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; + + # ponytail: global LD_LIBRARY_PATH so `cargo run` finds these without a shell.nix + home.sessionVariables.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [ + wayland + libxkbcommon + libGL + vulkan-loader + alsa-lib + udev + libx11 + libxcursor + libxi + libxrandr + libxcb + ]); } diff --git a/system/nix.nix b/system/nix.nix index 88d2b4a..2cd6977 100644 --- a/system/nix.nix +++ b/system/nix.nix @@ -3,4 +3,11 @@ { nix.settings.experimental-features = [ "nix-command" "flakes" ]; nixpkgs.config.allowUnfree = true; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + nix.settings.auto-optimise-store = true; }