mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-19 10:03:25 +00:00
chore: faster builds, fzf lua (#74)
This commit is contained in:
parent
80efbae1e9
commit
0db4171b0b
8 changed files with 52 additions and 25 deletions
|
|
@ -96,6 +96,9 @@ function M.setup_integrations()
|
|||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
|
||||
vim.keymap.set("n", "<C-f>", "<cmd>FzfLua files<cr>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "<C-s>", "<cmd>FzfLua live_grep<cr>", { 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)
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
{
|
||||
"<C-f>",
|
||||
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,
|
||||
},
|
||||
{ "<C-f>", "<cmd>FzfLua files<cr>" },
|
||||
{ "<C-s>", "<cmd>FzfLua live_grep<cr>" },
|
||||
{ "<leader>ff", "<cmd>FzfLua files<cr>" },
|
||||
{ "<leader>fg", "<cmd>FzfLua live_grep<cr>" },
|
||||
{ "<leader>fb", "<cmd>FzfLua buffers<cr>" },
|
||||
|
|
|
|||
|
|
@ -9,7 +9,13 @@ return {
|
|||
local neocodeium = require "neocodeium"
|
||||
neocodeium.setup()
|
||||
|
||||
vim.keymap.set("i", "<Right>", neocodeium.accept)
|
||||
vim.keymap.set("i", "<Right>", function()
|
||||
if neocodeium.visible() then
|
||||
neocodeium.accept()
|
||||
else
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Right>", true, false, true), "n", false)
|
||||
end
|
||||
end)
|
||||
vim.keymap.set("i", "<A-w>", neocodeium.accept_word)
|
||||
vim.keymap.set("i", "<A-a>", neocodeium.accept_line)
|
||||
vim.keymap.set("i", "<A-e>", neocodeium.cycle_or_complete)
|
||||
|
|
|
|||
|
|
@ -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}"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
4
justfile
4
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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue