From 9541a345bf4d68ab058fe1c740a17915d3bfd5ba Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Sat, 18 Apr 2026 14:35:56 -0400 Subject: [PATCH] chore: faster builds, fzf lua --- config/nvim/lua/config/canola.lua | 3 +++ config/nvim/lua/plugins/fzf.lua | 27 ++++++++++++++------------ config/nvim/lua/plugins/neocodeium.lua | 8 +++++++- home/devin.nix | 13 +++++++------ home/zsh.nix | 2 +- justfile | 4 ++-- modules/devshells.nix | 16 +++++++++++++-- modules/homebrew.nix | 4 +++- 8 files changed, 52 insertions(+), 25 deletions(-) diff --git a/config/nvim/lua/config/canola.lua b/config/nvim/lua/config/canola.lua index 39fad1f..91a49d4 100644 --- a/config/nvim/lua/config/canola.lua +++ b/config/nvim/lua/config/canola.lua @@ -96,6 +96,9 @@ function M.setup_integrations() callback = function(args) local bufnr = args.buf + vim.keymap.set("n", "", "FzfLua files", { buffer = bufnr }) + vim.keymap.set("n", "", "FzfLua live_grep", { buffer = bufnr }) + vim.keymap.set("n", "gC", function() show_all = not show_all require("canola").set_columns(show_all and detail_columns or base_columns) diff --git a/config/nvim/lua/plugins/fzf.lua b/config/nvim/lua/plugins/fzf.lua index 5e8ebcf..f18e6c2 100644 --- a/config/nvim/lua/plugins/fzf.lua +++ b/config/nvim/lua/plugins/fzf.lua @@ -38,6 +38,7 @@ return { local opts = { "default-title", winopts = { + fullscreen = true, border = "single", preview = { layout = "vertical", @@ -47,6 +48,18 @@ return { fzf_opts = { ["--layout"] = "reverse", }, + files = { + winopts = { preview = { hidden = true } }, + }, + git_files = { + winopts = { preview = { hidden = true } }, + }, + grep = { + _headers = {}, + }, + live_grep = { + _headers = {}, + }, } fzf.setup(opts) @@ -58,18 +71,8 @@ return { end end, keys = { - { - "", - function() - local fzf = require "fzf-lua" - local git_dir = vim.fn.system("git rev-parse --git-dir 2>/dev/null"):gsub("\n", "") - if vim.v.shell_error == 0 and git_dir ~= "" then - fzf.git_files() - else - fzf.files() - end - end, - }, + { "", "FzfLua files" }, + { "", "FzfLua live_grep" }, { "ff", "FzfLua files" }, { "fg", "FzfLua live_grep" }, { "fb", "FzfLua buffers" }, diff --git a/config/nvim/lua/plugins/neocodeium.lua b/config/nvim/lua/plugins/neocodeium.lua index 6ba587a..4a5c2b1 100644 --- a/config/nvim/lua/plugins/neocodeium.lua +++ b/config/nvim/lua/plugins/neocodeium.lua @@ -9,7 +9,13 @@ return { local neocodeium = require "neocodeium" neocodeium.setup() - vim.keymap.set("i", "", neocodeium.accept) + vim.keymap.set("i", "", function() + if neocodeium.visible() then + neocodeium.accept() + else + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", false) + end + end) vim.keymap.set("i", "", neocodeium.accept_word) vim.keymap.set("i", "", neocodeium.accept_line) vim.keymap.set("i", "", neocodeium.cycle_or_complete) diff --git a/home/devin.nix b/home/devin.nix index af5639f..6d92291 100644 --- a/home/devin.nix +++ b/home/devin.nix @@ -8,19 +8,20 @@ let sourceFile = ../config/devin/config.json; targetDir = "${config.xdg.configHome}/devin"; targetFile = "${targetDir}/config.json"; - bin = "${pkgs.coreutils}/bin"; + coreutilsBin = "${pkgs.coreutils}/bin"; + cmpBin = "${pkgs.diffutils}/bin/cmp"; in { # Devin rewrites this file when settings change, so seed a mutable copy # instead of pointing the path at the read-only Nix store. home.activation.installDevinConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - ${bin}/mkdir -p "${targetDir}" + ${coreutilsBin}/mkdir -p "${targetDir}" - if [ -f "${targetFile}" ] && ! ${bin}/cmp -s "${sourceFile}" "${targetFile}"; then - timestamp="$(${bin}/date +%Y%m%d%H%M%S)" - ${bin}/cp "${targetFile}" "${targetFile}.hm-bak.$timestamp" + if [ -f "${targetFile}" ] && ! ${cmpBin} -s "${sourceFile}" "${targetFile}"; then + timestamp="$(${coreutilsBin}/date +%Y%m%d%H%M%S)" + ${coreutilsBin}/cp "${targetFile}" "${targetFile}.hm-bak.$timestamp" fi - ${bin}/install -m 600 "${sourceFile}" "${targetFile}" + ${coreutilsBin}/install -m 600 "${sourceFile}" "${targetFile}" ''; } diff --git a/home/zsh.nix b/home/zsh.nix index a66fdeb..198fe4b 100644 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -30,7 +30,7 @@ shellAliases = { co = "codex --dangerously-bypass-approvals-and-sandbox"; ca = "cursor-agent"; - agent-claude = "cursor-agent --model=claude-opus-4-7-thinking --force"; + agent-claude = "cursor-agent --model=claude-opus-4-7-1M --force"; agent-codex = "cursor-agent --model=gpt-5.4-xhigh-fast --force"; cc = "claude"; ch = "claude-handoff"; diff --git a/justfile b/justfile index d9590da..a3475dc 100644 --- a/justfile +++ b/justfile @@ -15,10 +15,10 @@ build config='darwin': switch config='darwin': #!/usr/bin/env bash if [[ "{{config}}" == "darwin" ]]; then - sudo env PATH="$PATH" nix --extra-experimental-features 'nix-command flakes' run github:nix-darwin/nix-darwin/master#darwin-rebuild -- switch --flake path:.#{{config}} + sudo --set-home --preserve-env=PATH nix --extra-experimental-features 'nix-command flakes' run path:.#darwin-rebuild -- switch --flake path:.#{{config}} else backup_ext="hm-bak-$(date +%Y%m%d-%H%M%S)" - nix --extra-experimental-features 'nix-command flakes' run github:nix-community/home-manager -- switch --flake path:.#{{config}} -b "$backup_ext" + nix --extra-experimental-features 'nix-command flakes' run path:.#home-manager -- switch --flake path:.#{{config}} -b "$backup_ext" fi fmt: diff --git a/modules/devshells.nix b/modules/devshells.nix index db6bc90..0fde633 100644 --- a/modules/devshells.nix +++ b/modules/devshells.nix @@ -1,10 +1,22 @@ -{ ... }: +{ + inputs, + lib, + ... +}: { perSystem = - { pkgs, ... }: + { pkgs, system, ... }: { formatter = pkgs.nixfmt-tree; + packages = + { + home-manager = inputs.home-manager.packages.${system}.home-manager; + } + // lib.optionalAttrs (lib.hasSuffix "darwin" system) { + darwin-rebuild = inputs.nix-darwin.packages.${system}.darwin-rebuild; + }; + devShells.default = pkgs.mkShell { packages = with pkgs; [ deadnix diff --git a/modules/homebrew.nix b/modules/homebrew.nix index ad8f920..8071f31 100644 --- a/modules/homebrew.nix +++ b/modules/homebrew.nix @@ -6,7 +6,9 @@ onActivation = { autoUpdate = false; upgrade = false; - cleanup = "uninstall"; + # `brew bundle --cleanup` is by far the slowest part of darwin activation + # on this machine. Keep switches fast and do cleanup manually when needed. + cleanup = "none"; }; taps = [