diff --git a/docs/pureintent-eval-ralph-report.md b/docs/pureintent-eval-ralph-report.md index ce77e9c..0b0ed7b 100644 --- a/docs/pureintent-eval-ralph-report.md +++ b/docs/pureintent-eval-ralph-report.md @@ -76,13 +76,46 @@ Inputs declared in `flake.nix`: `nixos-hardware`, `nixos-unified`, `nixos-vscode-server`, `nixpkgs`, `nixvim`, `project-unknown`, `vira`, `zmx`. -Per-input blame is filled in as cycles run. +Per-input blame from Phase-1 probes (drop the module that imports the +input; everything else held constant; 3 runs each, eval-cache off): + +| input / module | path | wall when dropped | Δ saved | share | +|---|---|---:|---:|---:| +| baseline | — | 10.87 | — | 100 % | +| `nixvim` | `modules/home/editors/neovim/` | 6.90 | **3.97** | **36.5 %** | +| `vira` | `modules/home/services/vira.nix` | 9.59 | 1.28 | 11.8 % | +| `jumphost-nix` | `modules/home/work/juspay.nix` | 8.16 (vira out, jumphost-nix import removed) | 1.43 | 13.1 % | +| `kolu` | `modules/home/services/kolu.nix` | 10.37 | 0.50 | 4.6 % | +| `agenix` (HM module) | `modules/home/agenix.nix` | ≈ 8.07 | ≈ 0 | < noise | +| `agenix` (NixOS module) | `modules/nixos/common.nix:agenix` | 10.82 | ≈ 0 | < noise | +| `programs.jumphost.*` body | `modules/home/work/juspay.nix` | 9.51 → 9.56 | 0.05 | < noise | +| `claude-code` | `modules/home/claude-code` | 11.01 | ≈ 0 | < noise | +| `buildMachines` | `modules/home/nix/buildMachines*` | 10.89 | ≈ 0 | < noise | +| `incus`, `beszel`, `firefox`, `ttyd` | various | ≈ 10.85–10.92 | ≈ 0 | < noise | + +Compound floors: + +| drop | wall (s) | reduction | +|---|---:|---:| +| baseline | 10.87 | — | +| nixvim + vira + juspay + agenix (HM+NixOS) | 4.29 | −60.5 % | +| above + kolu | 3.85 | −64.6 % | + +So the absolute lower bound (with these four heavies stubbed out) is +≈ 3.85 s — that's the cost of nixpkgs + home-manager + nixos-unified + +everything else combined. + +The `home-manager.sharedModules` plumbing block in +`modules/nixos/common.nix` was probed independently: removing it left +the wall time unchanged (10.95 s ≈ 10.87 s), so the per-host HM-setup +boilerplate itself isn't a contributor. ## Optimization log | # | hypothesis | mutation | wall (s) | Δ vs baseline | committed? | notes | |---|---|---|---|---|---|---| | 0 | — | baseline | 10.87 | — | — | reference | +| 1 | nixvim is 36 % of eval; the cost is the option system, not the resulting nvim binary | delete `inputs.nixvim` + the nixvim module; replace `modules/home/editors/neovim/` with a minimal `programs.neovim { enable; defaultEditor; vimAlias; viAlias; }` | **6.98** | **−3.89 s (−35.8 %)** | ✅ | 7-run median; range 7.73–6.94 (first-run warm-up jitter). Other configs (`naiveintent`, `infinitude-macos`, `srid@zest`) still eval cleanly. **Behaviour note:** nvim is now plain — none of the previous plugins (rose-pine, telescope, treesitter, lualine, noice, LSP keymaps, nvim-tree, lazygit, outline-nvim, mapleader) survive. User explicitly approved dropping nixvim. | ## Dead ends diff --git a/flake.lock b/flake.lock index 406f737..4bccf30 100644 --- a/flake.lock +++ b/flake.lock @@ -423,27 +423,6 @@ } }, "flake-parts_6": { - "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1777988971, - "narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_7": { "inputs": { "nixpkgs-lib": [ "vira", @@ -466,7 +445,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1731533236, @@ -1161,28 +1140,6 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts_6", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_4" - }, - "locked": { - "lastModified": 1778510615, - "narHash": "sha256-cMNCx8mQTJnVkA6kt3B3ArGpCOOniYn644hH0mJHSsw=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "fa8cd368d27cf9541f086485884928315abdcc8c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, "process-compose-flake": { "locked": { "lastModified": 1767863885, @@ -1270,7 +1227,6 @@ "nixos-unified": "nixos-unified_2", "nixos-vscode-server": "nixos-vscode-server", "nixpkgs": "nixpkgs_4", - "nixvim": "nixvim", "project-unknown": "project-unknown", "vira": "vira", "zmx": "zmx" @@ -1397,21 +1353,6 @@ "type": "github" } }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tabler-icons-hs": { "flake": false, "locked": { @@ -1486,7 +1427,7 @@ "inputs": { "co-log-effectful": "co-log-effectful", "devour-flake": "devour-flake", - "flake-parts": "flake-parts_7", + "flake-parts": "flake-parts_6", "fourmolu-nix": "fourmolu-nix_3", "git-hooks": "git-hooks_5", "haskell-flake": "haskell-flake_3", diff --git a/flake.nix b/flake.nix index c43d1bd..ffc762e 100644 --- a/flake.nix +++ b/flake.nix @@ -46,10 +46,6 @@ llm-agents.url = "github:numtide/llm-agents.nix/d9583b68fdc553936b35dc6ca206d8d8dd552e5b"; llm-agents.inputs.nixpkgs.follows = "nixpkgs"; - # Neovim - nixvim.url = "github:nix-community/nixvim"; - nixvim.inputs.nixpkgs.follows = "nixpkgs"; - # Emanote & Imako emanote.url = "github:srid/emanote"; imako.url = "github:srid/imako"; diff --git a/modules/flake-parts/nixos-flake.nix b/modules/flake-parts/nixos-flake.nix index d5b95ef..22dcda2 100644 --- a/modules/flake-parts/nixos-flake.nix +++ b/modules/flake-parts/nixos-flake.nix @@ -16,7 +16,6 @@ "nix-darwin" # "nixos-hardware" "nix-index-database" - "nixvim" ]; }; }; diff --git a/modules/home/editors/neovim/default.nix b/modules/home/editors/neovim/default.nix index a8fe9dc..d94c6dc 100644 --- a/modules/home/editors/neovim/default.nix +++ b/modules/home/editors/neovim/default.nix @@ -1,127 +1,9 @@ -{ flake, pkgs, ... }: - -let - inherit (flake) inputs; -in +{ ... }: { - imports = [ - inputs.nixvim.homeModules.nixvim - ]; - programs.nixvim = { + programs.neovim = { enable = true; defaultEditor = true; - - imports = [ - ./nvim-tree.nix - ./lazygit.nix - ]; - - # Theme - colorschemes.rose-pine.enable = true; - - # Settings - opts = { - expandtab = true; - shiftwidth = 2; - smartindent = true; - tabstop = 2; - number = true; - clipboard = "unnamedplus"; - termguicolors = true; - }; - - # Keymaps - globals = { - mapleader = " "; - }; - - extraPlugins = [ - pkgs.vimPlugins.outline-nvim - ]; - - plugins = { - # UI - web-devicons.enable = true; - lualine.enable = true; - bufferline.enable = true; - treesitter = { - enable = true; - }; - haskell-scope-highlighting.enable = true; - which-key = { - enable = true; - }; - noice = { - # WARNING: This is considered experimental feature, but provides nice UX - enable = true; - settings.presets = { - bottom_search = true; - command_palette = true; - long_message_to_split = true; - #inc_rename = false; - #lsp_doc_border = false; - }; - }; - telescope = { - enable = true; - keymaps = { - "ff" = { - options.desc = "file finder"; - action = "find_files"; - }; - "fr" = { - options.desc = "recent files"; - action = "oldfiles"; - }; - "fg" = { - options.desc = "find via grep"; - action = "live_grep"; - }; - "T" = { - options.desc = "switch colorscheme"; - action = "colorscheme"; - }; - }; - extensions = { - file-browser.enable = true; - ui-select.enable = true; - frecency.enable = true; - fzf-native.enable = true; - }; - }; - - # LSP - # https://github.com/nix-community/nixvim/blob/main/plugins/lsp/default.nix - lsp = { - enable = true; - keymaps = { - lspBuf = { - "gd" = "definition"; - "gD" = "references"; - "gt" = "type_definition"; - "gi" = "implementation"; - "K" = "hover"; - "A" = "code_action"; - }; - diagnostic = { - "k" = "goto_prev"; - "j" = "goto_next"; - }; - }; - servers = { - hls = { - enable = true; - installGhc = false; - }; - marksman.enable = true; - nil_ls.enable = true; - rust_analyzer = { - # enable = true; - installCargo = false; - installRustc = false; - }; - }; - }; - }; + vimAlias = true; + viAlias = true; }; } diff --git a/modules/home/editors/neovim/lazygit.nix b/modules/home/editors/neovim/lazygit.nix deleted file mode 100644 index 38cdfd2..0000000 --- a/modules/home/editors/neovim/lazygit.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - plugins.lazygit.enable = true; - keymaps = [ - { - action = "LazyGit"; - key = "gg"; - } - ]; - -} diff --git a/modules/home/editors/neovim/nvim-tree.nix b/modules/home/editors/neovim/nvim-tree.nix deleted file mode 100644 index ed14a12..0000000 --- a/modules/home/editors/neovim/nvim-tree.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - plugins.nvim-tree.enable = true; - keymaps = [ - { - action = "NvimTreeFindFileToggle"; - key = "tt"; - } - { - action = "NvimTreeFindFile"; - key = "tf"; - } - ]; -}