Compare commits

..

1 Commits

Author SHA1 Message Date
74fb7a2b4c wip: using custom-flakes implementation 2025-05-08 21:35:45 -04:00
5 changed files with 517 additions and 259 deletions

View File

@ -1,5 +1,5 @@
%-darwin: %-darwin:
sudo darwin-rebuild --flake ./nix/base-system $* darwin-rebuild --flake ./nix/base-system $*
update-input-%: update-input-%:
nix flake update $* ./nix/base-system/ nix flake lock --update-input $* ./nix/base-system/

View File

@ -6,11 +6,10 @@ in
nix = { nix = {
package = pkgs.nix; package = pkgs.nix;
enable = true;
# SEE: https://github.com/NixOS/nix/issues/4119#issuecomment-1734738812 # SEE: https://github.com/NixOS/nix/issues/4119#issuecomment-1734738812
settings.sandbox = "relaxed"; settings.sandbox = "relaxed";
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes repl-flake
extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux
trusted-users = root zaphar trusted-users = root zaphar
''; '';
@ -348,6 +347,9 @@ in
vfkit vfkit
]; ];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
#services.spacebar.enable = true; #services.spacebar.enable = true;
#services.spacebar.package = "${pkgs.spacebar}"; #services.spacebar.package = "${pkgs.spacebar}";
@ -363,7 +365,6 @@ in
(allow file-read* file-write* process-exec mach-lookup (subpath "${builtins.storeDir}")) (allow file-read* file-write* process-exec mach-lookup (subpath "${builtins.storeDir}"))
''; '';
}; };
system.primaryUser = "zaphar";
# Used for backwards compatibility, please read the changelog before changing. # Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog # $ darwin-rebuild changelog
system.stateVersion = 4; system.stateVersion = 4;

View File

@ -36,22 +36,6 @@
"type": "github" "type": "github"
} }
}, },
"claude-code-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1749595024,
"narHash": "sha256-jKWm3lN5nyZ1BsIKMFt4EQhb0n+iyEyOw79Rj/A3yZI=",
"owner": "greggh",
"repo": "claude-code.nvim",
"rev": "275c47615f4424a0329290ce1d0c18a8320fd8b0",
"type": "github"
},
"original": {
"owner": "greggh",
"repo": "claude-code.nvim",
"type": "github"
}
},
"clio-flake": { "clio-flake": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -79,7 +63,6 @@
"custom-flakes": { "custom-flakes": {
"inputs": { "inputs": {
"avante-src": "avante-src", "avante-src": "avante-src",
"claude-code-nvim-src": "claude-code-nvim-src",
"d2-vim-src": "d2-vim-src", "d2-vim-src": "d2-vim-src",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"gomod2nix-src": "gomod2nix-src", "gomod2nix-src": "gomod2nix-src",
@ -96,14 +79,16 @@
"rust-overlay": "rust-overlay_3", "rust-overlay": "rust-overlay_3",
"tree-sitter-cli-src": "tree-sitter-cli-src", "tree-sitter-cli-src": "tree-sitter-cli-src",
"treesitter-context": "treesitter-context", "treesitter-context": "treesitter-context",
"victoria-logs-src": "victoria-logs-src",
"victoria-metrics-src": "victoria-metrics-src",
"zig-src": "zig-src" "zig-src": "zig-src"
}, },
"locked": { "locked": {
"lastModified": 1751479151, "lastModified": 1746633381,
"narHash": "sha256-JxS2yHOiScQQOk8YvK4UAGx68iQJXKnL5qNvV0+9s9A=", "narHash": "sha256-9Vgnz0/Myw+XdZUxNWYhfdfRzz1SSDQIFjrhaXFcJpk=",
"owner": "zaphar", "owner": "zaphar",
"repo": "nix-flakes", "repo": "nix-flakes",
"rev": "0442ff179bd8e82ca3fe713d22e258c89f9caccc", "rev": "30a4fb242f5e6542b842be1972d953d20945ed7a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -173,16 +158,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749744770, "lastModified": 1715871485,
"narHash": "sha256-MEM9XXHgBF/Cyv1RES1t6gqAX7/tvayBC1r/KPyK1ls=", "narHash": "sha256-ywapEXmBBI+DVRx/YYC6+6Lk+W8vhShz1uJNvqPKzng=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "536f951efb1ccda9b968e3c9dee39fbeb6d3fdeb", "rev": "cb02884fa1ff5a619a44ab5f1bcc4dedd2d623c2",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "lnl7", "owner": "lnl7",
"ref": "nix-darwin-25.05",
"repo": "nix-darwin", "repo": "nix-darwin",
"type": "github" "type": "github"
} }
@ -256,6 +240,38 @@
} }
}, },
"flake-compat_4": { "flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_6": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1648199409, "lastModified": 1648199409,
@ -271,7 +287,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_5": { "flake-compat_7": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1673956053,
@ -308,6 +324,48 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -554,7 +612,52 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_5",
"gitignore": "gitignore",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1746537231,
"narHash": "sha256-Wb2xeSyOsCoTCTj7LOoD6cdKLEROyFAArnYoS+noCWo=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "fa466640195d38ec97cf0493d6d6882bc4d14969",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"sile-flake", "sile-flake",
@ -594,6 +697,23 @@
"type": "github" "type": "github"
} }
}, },
"harpoon-src": {
"flake": false,
"locked": {
"lastModified": 1706306053,
"narHash": "sha256-RjwNUuKQpLkRBX3F9o25Vqvpu3Ah1TCFQ5Dk4jXhsbI=",
"owner": "ThePrimeagen",
"repo": "harpoon",
"rev": "a38be6e0dd4c6db66997deab71fc4453ace97f9c",
"type": "github"
},
"original": {
"owner": "ThePrimeagen",
"ref": "harpoon2",
"repo": "harpoon",
"type": "github"
}
},
"heracles-flake": { "heracles-flake": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
@ -616,6 +736,28 @@
"type": "github" "type": "github"
} }
}, },
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1744693102,
"narHash": "sha256-1Z4WPGVky4w3lrhrgs89OKsLzPdtkbi1bPLNFWsoLfY=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "5b6cec51c9ec095a0d3fd4c8eeb53eb5c59ae33e",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -676,11 +818,11 @@
"rust-overlay": "rust-overlay_5" "rust-overlay": "rust-overlay_5"
}, },
"locked": { "locked": {
"lastModified": 1749118509, "lastModified": 1737911819,
"narHash": "sha256-HKqpDREmzpCskJdfUwvUMJwHTx1RHL7/XMJMUDDMVJA=", "narHash": "sha256-EsxRZIwe1EaacXj3yp1xo2pqHufr/ZLaqOPnsOmEmI0=",
"owner": "martinvonz", "owner": "martinvonz",
"repo": "jj", "repo": "jj",
"rev": "0dc9eb5187b79e3722d20f3c5e2c584edb501e1a", "rev": "00069119d8165c9c9b3b176c00c3171c73c05138",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -799,7 +941,7 @@
}, },
"naersk_5": { "naersk_5": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_15" "nixpkgs": "nixpkgs_16"
}, },
"locked": { "locked": {
"lastModified": 1650101877, "lastModified": 1650101877,
@ -817,7 +959,7 @@
}, },
"naersk_6": { "naersk_6": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_16" "nixpkgs": "nixpkgs_17"
}, },
"locked": { "locked": {
"lastModified": 1721727458, "lastModified": 1721727458,
@ -865,6 +1007,46 @@
"type": "github" "type": "github"
} }
}, },
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": "nixpkgs_12",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1746693006,
"narHash": "sha256-IztZLDIwNOvJCxqnBmaU7/oEjOBLJZgmLoK0ikQGQkM=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "b969e3c7bfcb7a438382dd6e379788f762094df5",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1746661883,
"narHash": "sha256-kjIDvE1KGhACcvAJGLgzaQDkenH8dN9Hapfc0/b/3bQ=",
"owner": "neovim",
"repo": "neovim",
"rev": "1b8ae4336db86ff95998223cc6bd8e07229d237d",
"type": "github"
},
"original": {
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"nil-flake": { "nil-flake": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_5",
@ -888,7 +1070,7 @@
"nil-flake_2": { "nil-flake_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_10", "flake-utils": "flake-utils_10",
"nixpkgs": "nixpkgs_12", "nixpkgs": "nixpkgs_13",
"rust-overlay": "rust-overlay_6" "rust-overlay": "rust-overlay_6"
}, },
"locked": { "locked": {
@ -923,27 +1105,27 @@
}, },
"nixpkgs-darwin": { "nixpkgs-darwin": {
"locked": { "locked": {
"lastModified": 1749596380, "lastModified": 1735564410,
"narHash": "sha256-7DEKr2x/jIAKkwHPNNjG6lGUz9nk8SGrbyaeAFMtN34=", "narHash": "sha256-HB/FA0+1gpSs8+/boEavrGJH+Eq08/R2wWNph1sM1Dg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "210a4a2e3d3853be3a6017e68d2897771fdace35", "rev": "1e7a8f391f1a490460760065fa0630b5520f9cf8",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixpkgs-25.05-darwin", "ref": "nixpkgs-24.05-darwin",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_10": { "nixpkgs_10": {
"locked": { "locked": {
"lastModified": 1747920628, "lastModified": 1737557748,
"narHash": "sha256-IlAuXnIi+ZmyS89tt1YOFDCv7FKs9bNBHd3MXMp8PxE=", "narHash": "sha256-BaMuhctP1x00+8cBE2cJveJQb70/tWHI50MHj/ZrtOY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e314d5c6d3b3a0f40ec5bcbc007b0cbe412f48ae", "rev": "606996d74f6e2a12635d41c1bf58bfc7ea3bb5ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -970,6 +1152,22 @@
} }
}, },
"nixpkgs_12": { "nixpkgs_12": {
"locked": {
"lastModified": 1746576598,
"narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_13": {
"locked": { "locked": {
"lastModified": 1690441914, "lastModified": 1690441914,
"narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=", "narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=",
@ -985,23 +1183,23 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_13": { "nixpkgs_14": {
"locked": { "locked": {
"lastModified": 1749747690, "lastModified": 1738579205,
"narHash": "sha256-FPhMfYq+ngKpZiYaOblqR6S9z9JVpTlW8EaQ98xwkkU=", "narHash": "sha256-o6BeeanSUALvz8oL2CHOikVjCf7j+HqlA0WGvKOUX3Q=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f7d4856c2d1af130193777964535304fdc76e368", "rev": "be5cf18b3d26ba2db938a72ade93ac8a9a7462ff",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "release-25.05", "ref": "release-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_14": { "nixpkgs_15": {
"locked": { "locked": {
"lastModified": 1689850295, "lastModified": 1689850295,
"narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=",
@ -1017,7 +1215,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_15": { "nixpkgs_16": {
"locked": { "locked": {
"lastModified": 1650109093, "lastModified": 1650109093,
"narHash": "sha256-tqlnKrAdJktRLXTou9le0oTqrYBAFpGscV5RADdpArU=", "narHash": "sha256-tqlnKrAdJktRLXTou9le0oTqrYBAFpGscV5RADdpArU=",
@ -1031,20 +1229,6 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_16": {
"locked": {
"lastModified": 1729658218,
"narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_17": { "nixpkgs_17": {
"locked": { "locked": {
"lastModified": 1729658218, "lastModified": 1729658218,
@ -1060,6 +1244,20 @@
} }
}, },
"nixpkgs_18": { "nixpkgs_18": {
"locked": {
"lastModified": 1729658218,
"narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_19": {
"locked": { "locked": {
"lastModified": 1682109806, "lastModified": 1682109806,
"narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=", "narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=",
@ -1213,7 +1411,7 @@
}, },
"nurl-flake_2": { "nurl-flake_2": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_14" "nixpkgs": "nixpkgs_15"
}, },
"locked": { "locked": {
"lastModified": 1701273941, "lastModified": 1701273941,
@ -1237,12 +1435,14 @@
"d2-vim-src": "d2-vim-src_2", "d2-vim-src": "d2-vim-src_2",
"darwin": "darwin_2", "darwin": "darwin_2",
"durnitisp-flake": "durnitisp-flake", "durnitisp-flake": "durnitisp-flake",
"harpoon-src": "harpoon-src",
"heracles-flake": "heracles-flake", "heracles-flake": "heracles-flake",
"jujutsu-flake": "jujutsu-flake", "jujutsu-flake": "jujutsu-flake",
"mcphub-flake": "mcphub-flake", "mcphub-flake": "mcphub-flake",
"neogit-src": "neogit-src_2", "neogit-src": "neogit-src_2",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nil-flake": "nil-flake_2", "nil-flake": "nil-flake_2",
"nixpkgs": "nixpkgs_13", "nixpkgs": "nixpkgs_14",
"nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-darwin": "nixpkgs-darwin",
"nurl-flake": "nurl-flake_2", "nurl-flake": "nurl-flake_2",
"roslyn-lsp": "roslyn-lsp_2", "roslyn-lsp": "roslyn-lsp_2",
@ -1250,6 +1450,7 @@
"rust-overlay-flake": "rust-overlay-flake", "rust-overlay-flake": "rust-overlay-flake",
"sheetsui-flake": "sheetsui-flake", "sheetsui-flake": "sheetsui-flake",
"sile-flake": "sile-flake", "sile-flake": "sile-flake",
"treesitter-context": "treesitter-context_2",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
@ -1289,7 +1490,7 @@
}, },
"runwhen-flake": { "runwhen-flake": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_6",
"flake-utils": "flake-utils_11", "flake-utils": "flake-utils_11",
"naersk": "naersk_5" "naersk": "naersk_5"
}, },
@ -1426,11 +1627,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747967795, "lastModified": 1737685583,
"narHash": "sha256-76s4jDRbQzxRO+5y8ilMp5V30qVgY9R6n8U7aOap8ig=", "narHash": "sha256-p+NVABRpGi+pT+xxf9HcLcFVxG6L+vEEy+NwzB9T0f8=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "f1d5bfa8c692cacd798a3e1fb93d54c1b9ac701a", "rev": "eb64cbcc8eee0fa87ebded92805280d2ec97415a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1489,7 +1690,7 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils_13", "flake-utils": "flake-utils_13",
"naersk": "naersk_6", "naersk": "naersk_6",
"nixpkgs": "nixpkgs_17", "nixpkgs": "nixpkgs_18",
"rust-overlay": "rust-overlay_7" "rust-overlay": "rust-overlay_7"
}, },
"locked": { "locked": {
@ -1508,11 +1709,11 @@
}, },
"sile-flake": { "sile-flake": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_5", "flake-compat": "flake-compat_7",
"flake-utils": "flake-utils_14", "flake-utils": "flake-utils_14",
"gitignore": "gitignore", "gitignore": "gitignore_2",
"libtexpdf-src": "libtexpdf-src", "libtexpdf-src": "libtexpdf-src",
"nixpkgs": "nixpkgs_18" "nixpkgs": "nixpkgs_19"
}, },
"locked": { "locked": {
"lastModified": 1694595810, "lastModified": 1694595810,
@ -1724,6 +1925,27 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1746216483,
"narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "29ec5026372e0dec56f890e50dbe4f45930320fd",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treesitter-context": { "treesitter-context": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1741,13 +1963,30 @@
"type": "github" "type": "github"
} }
}, },
"treesitter-context_2": {
"flake": false,
"locked": {
"lastModified": 1693236978,
"narHash": "sha256-B6BXeFEWxTFf46JrlatsxEQcC6+/hPIDBb5cIcJpLZg=",
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-context",
"rev": "e6b743ccd4e780bc9cd85b707de67df72eea1a23",
"type": "github"
},
"original": {
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-context",
"rev": "e6b743ccd4e780bc9cd85b707de67df72eea1a23",
"type": "github"
}
},
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1751349533, "lastModified": 1746152631,
"narHash": "sha256-5XRh0mB06/7WYDLu9ZXsx1GhyvvNVZDtPyg34sUCLJs=", "narHash": "sha256-zBuvmL6+CUsk2J8GINpyy8Hs1Zp4PP6iBWSmZ4SCQ/s=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bdfd0f2afcf764e531d0960c821ab070a6174b15", "rev": "032bc6539bd5f14e9d0c51bd79cfe9a055b094c3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1755,6 +1994,40 @@
"type": "indirect" "type": "indirect"
} }
}, },
"victoria-logs-src": {
"flake": false,
"locked": {
"lastModified": 1742084154,
"narHash": "sha256-Oxy4MntciWUij83zyHixlEDa1DgeG/2ntNN+Nbw8xJg=",
"owner": "VictoriaMetrics",
"repo": "VictoriaMetrics",
"rev": "771233ebcd706578c44ed82047c714381a75ab5a",
"type": "github"
},
"original": {
"owner": "VictoriaMetrics",
"ref": "v1.17.0-victorialogs",
"repo": "VictoriaMetrics",
"type": "github"
}
},
"victoria-metrics-src": {
"flake": false,
"locked": {
"lastModified": 1742560966,
"narHash": "sha256-iOeGz0qDeKMdafTDqI4/IMkXZ6KLdMDtFie3jwv2uvU=",
"owner": "VictoriaMetrics",
"repo": "VictoriaMetrics",
"rev": "e950846534ea594940a0f69845ef60a053c98ffd",
"type": "github"
},
"original": {
"owner": "VictoriaMetrics",
"ref": "v1.114.0",
"repo": "VictoriaMetrics",
"type": "github"
}
},
"zig-src": { "zig-src": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@ -1,15 +1,15 @@
{ {
inputs = { inputs = {
# Default to sane nixpkgs versions # Default to sane nixpkgs versions
nixpkgs.url = "github:nixos/nixpkgs/release-25.05"; nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
unstable.url = "nixpkgs"; unstable.url = "nixpkgs";
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin"; nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
#lean4-flake = { #lean4-flake = {
# url = "github:leanprover/lean4/v4.4.0"; # url = "github:leanprover/lean4/v4.4.0";
# inputs.nixpkgs.follows = "nixpkgs"; # inputs.nixpkgs.follows = "nixpkgs";
#}; #};
darwin = { darwin = {
url = "github:lnl7/nix-darwin/nix-darwin-25.05"; url = "github:lnl7/nix-darwin";
# ensure that darwinSystem uses our nixpkgs version # ensure that darwinSystem uses our nixpkgs version
inputs.nixpkgs.follows = "nixpkgs-darwin"; inputs.nixpkgs.follows = "nixpkgs-darwin";
}; };
@ -30,17 +30,16 @@
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
#neovim-flake = {
# url = "github:neovim/neovim/stable?dir=contrib";
# # NOTE(jeremy): Currently this needs a newer nixpkgs version
# #inputs.nixpkgs.follows = "nixpkgs";
#};
jujutsu-flake.url = "github:martinvonz/jj"; jujutsu-flake.url = "github:martinvonz/jj";
custom-flakes = { custom-flakes = {
url = "github:zaphar/nix-flakes"; url = "github:zaphar/nix-flakes";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
harpoon-src = {
url = "github:ThePrimeagen/harpoon/harpoon2";
flake = false;
};
neogit-src = { neogit-src = {
url = "github:NeogitOrg/neogit"; url = "github:NeogitOrg/neogit";
flake = false; flake = false;
@ -49,6 +48,11 @@
url = "github:terrastruct/d2-vim"; url = "github:terrastruct/d2-vim";
flake = false; flake = false;
}; };
# We need to pin to this version of treesitter because it breaks after this revision
treesitter-context = {
url = "github:nvim-treesitter/nvim-treesitter-context/e6b743ccd4e780bc9cd85b707de67df72eea1a23";
flake = false;
};
roslyn-lsp = { roslyn-lsp = {
url = "github:zaphar/roslyn.nvim/main"; url = "github:zaphar/roslyn.nvim/main";
flake = false; flake = false;
@ -67,9 +71,11 @@
agenix-flake, agenix-flake,
nil-flake, nil-flake,
nurl-flake, nurl-flake,
harpoon-src,
custom-flakes, custom-flakes,
unstable, unstable,
heracles-flake, heracles-flake,
neovim-nightly-overlay,
clio-flake, clio-flake,
sheetsui-flake, sheetsui-flake,
mcphub-flake, mcphub-flake,
@ -79,18 +85,27 @@
vimModule = system: let vimModule = system: let
nil-pkg = nil-flake.packages."${system}".default; nil-pkg = nil-flake.packages."${system}".default;
mcp-hub-binary = custom-flakes.packages."${system}".mcp-hub; mcp-hub-binary = custom-flakes.packages."${system}".mcp-hub;
claude-code-binary = custom-flakes.packages."${system}".claude-code; notion-mcp-server = custom-flakes.packages."${system}".notion-mcp-server;
in in
{ config, pkgs, ...}: let { config, pkgs, ...}: let
unstablePkgs = import unstable { inherit system; }; unstablePkgs = import unstable { inherit system; };
possession-nvim = pkgs.callPackage ./possession-nvim.nix {
inherit (pkgs.vimUtils) buildVimPlugin;
inherit (pkgs) fetchFromGitHub;
};
harpoon-nvim = pkgs.vimUtils.buildVimPlugin {
pname = "harpoon";
version = "2024-01-28";
src = harpoon-src;
};
neogit-nvim = custom-flakes.packages."${system}".neogit-nvim; neogit-nvim = custom-flakes.packages."${system}".neogit-nvim;
d2-vim = custom-flakes.packages."${system}".d2-vim; d2-vim = custom-flakes.packages."${system}".d2-vim;
hunk-nvim = custom-flakes.packages."${system}".hunk-nvim; hunk-nvim = custom-flakes.packages."${system}".hunk-nvim;
# TODO(zaphar): Apparently this is a remote plugin so it needs some additional love. # TODO(zaphar): Apparently this is a remote plugin so it needs some additional love.
#nvim-bnf = custom-flakes.packages."${system}".nvim-bnf; #nvim-bnf = custom-flakes.packages."${system}".nvim-bnf;
nvim-treesitter-context = custom-flakes.packages."${system}".nvim-treesitter-context;
roslyn-nvim = custom-flakes.packages."${system}".roslyn-nvim; roslyn-nvim = custom-flakes.packages."${system}".roslyn-nvim;
ionide-nvim = custom-flakes.packages."${system}".ionide-nvim; ionide-nvim = custom-flakes.packages."${system}".ionide-nvim;
claude-code-nvim = custom-flakes.packages."${system}".claude-code-nvim;
# TODO(zaphar): Until nixpkgs update to a newer version of tree-sitter the queries will be wrong # TODO(zaphar): Until nixpkgs update to a newer version of tree-sitter the queries will be wrong
# for csharp # for csharp
#tree-sitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix { #tree-sitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix {
@ -104,35 +119,15 @@
# inherit (pkgs) fetchFromGitHub; # inherit (pkgs) fetchFromGitHub;
#}; #};
mcphub-nvim = mcphub-flake.packages."${system}".default; mcphub-nvim = mcphub-flake.packages."${system}".default;
in { my-neovim = pkgs.wrapNeovim unstablePkgs.neovim-unwrapped {
imports = [ configure = {
./program-neovim.nix customRC = "lua << EOF
];
config = {
environment.variables = {
EDITOR="nvim";
PAGER="less -R";
OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
};
nixpkgs.overlays = [
(final: prev: {
lorri = unstablePkgs.lorri;
})
];
programs = with unstablePkgs; {
neovim.enable = true;
neovim.vimAlias = true;
neovim.viAlias = true;
neovim.package = unstablePkgs.neovim-unwrapped;
neovim.configure = {
customRC = "lua << EOF
${builtins.readFile ./init.lua} ${builtins.readFile ./init.lua}
EOF"; EOF";
packages.myVimPackage = { packages.myPlugins = {
start = (with pkgs.vimPlugins; [ start = (with pkgs.vimPlugins; [
copilot-lua copilot-lua
avante-nvim custom-flakes.packages."${system}".avante-nvim
vim-sile vim-sile
nvim-tree-lua nvim-tree-lua
nvim-lspconfig nvim-lspconfig
@ -201,21 +196,39 @@ EOF";
vim-dasht vim-dasht
direnv-vim direnv-vim
mcphub-nvim mcphub-nvim
claude-code-nvim
]) ++ [ ]) ++ [
possession-nvim
harpoon-nvim
d2-vim d2-vim
hunk-nvim hunk-nvim
neogit-nvim neogit-nvim
# tree-sitter-csharp.neovim-plugin # Until nixpkgs updates their nvim-treesitter config the csharp queries will be broken # tree-sitter-csharp.neovim-plugin # Until nixpkgs updates their nvim-treesitter config the csharp queries will be broken
]; ];
}; };
}; };
}; };
in {
imports = [
./program-neovim.nix
];
config = {
environment.variables = {
EDITOR="nvim";
PAGER="less -R";
OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
};
nixpkgs.overlays = [
(final: prev: {
lorri = unstablePkgs.lorri;
copilot-lua = unstablePkgs.vimPlugins.copilot-lua;
})
];
environment.systemPackages = (with pkgs; [ environment.systemPackages = (with pkgs; [
terraform-ls terraform-ls
tinymist
nodePackages.typescript-language-server nodePackages.typescript-language-server
nodePackages.jsdoc nodePackages.jsdoc
python312Packages.jedi-language-server
# TODO find a version of the julia package that will install # TODO find a version of the julia package that will install
# on darwin and add it as an overlay # on darwin and add it as an overlay
nil-pkg nil-pkg
@ -227,7 +240,8 @@ EOF";
devenv devenv
unstablePkgs.fq unstablePkgs.fq
mcp-hub-binary mcp-hub-binary
claude-code-binary notion-mcp-server
my-neovim
]); ]);
}; };
}; };
@ -269,7 +283,6 @@ EOF";
uv = unstablePkgs.uv; uv = unstablePkgs.uv;
quint = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint"; quint = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint";
quint-lsp = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint-language-server"; quint-lsp = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint-language-server";
ollama = unstablePkgs.ollama;
}) })
rust-overlay rust-overlay
]; ];
@ -296,11 +309,13 @@ EOF";
}; };
}; };
environment.systemPackages = (with pkgs; [ environment.systemPackages = (with pkgs; [
isabelle
sheetsui sheetsui
lean4 lean4
quint quint
quint-lsp quint-lsp
terraform # TODO(jeremy): Replace with opentofu when that is an option. terraform # TODO(jeremy): Replace with opentofu when that is an option.
nomad
oha oha
nodejs nodejs
gnumake gnumake

View File

@ -20,10 +20,6 @@ vim.opt.fileformats = "unix,dos"
-- Recommended by Avante docs -- Recommended by Avante docs
-- views can only be fully collapsed with the global statusline -- views can only be fully collapsed with the global statusline
vim.opt.laststatus = 3 vim.opt.laststatus = 3
-- formatexpr defaulted to the lsp provider by default recently
-- which breaks `gq` and company paragraph formatting in non lsp
-- contexts.
vim.opt.formatexpr = ""
vim.g.BASH_AuthorName = 'Jeremy Wall' vim.g.BASH_AuthorName = 'Jeremy Wall'
vim.g.BASH_AuthorRef = 'jw' vim.g.BASH_AuthorRef = 'jw'
@ -47,23 +43,6 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
end, end,
}) })
vim.api.nvim_create_autocmd({ "BufNewfile", "BufRead" }, {
callback = function(args)
-- If treesitter supports this filetype then use the treesitter fold expression
local ft = vim.bo.filetype
if ft and ft ~= "" then
-- Safely check if a parser exists for this filetype
local has_parser = pcall(function() return vim.treesitter.language.inspect(ft) end)
if has_parser then
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo.foldmethod = 'expr'
vim.wo.foldlevel = 10
end
end
end,
})
vim.cmd([[ vim.cmd([[
au BufNewFile,BufRead *Makefile,*.mk set noexpandtab au BufNewFile,BufRead *Makefile,*.mk set noexpandtab
]]) ]])
@ -168,26 +147,23 @@ local caps = vim.tbl_deep_extend(
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local configure_lsp = function(name, config)
vim.lsp.enable(name)
vim.lsp.config(name, config)
end
-- Typst -- Typst
configure_lsp('tinymist', { lspconfig.tinymist.setup {
capabilities = caps, capabilities = caps,
settings = { settings = {
exportPdf = "onSave", exportPdf = "onSave",
}, },
}) }
-- Terraform lsp setup -- Terraform lsp setup
configure_lsp('terraformls', {}) lspconfig.terraformls.setup {}
-- Nix language server support -- Nix language server support
configure_lsp('nil_ls', { lspconfig.nil_ls.setup {
capabilities = caps, capabilities = caps,
}) }
lspconfig.jedi_language_server.setup {}
require('roslyn').setup({ require('roslyn').setup({
-- client, bufnr -- client, bufnr
@ -199,14 +175,23 @@ require('roslyn').setup({
log_level = "Trace", log_level = "Trace",
}); });
-- Typescript language server support --ocaml
configure_lsp('tsserver', { lspconfig.ocamllsp.setup {
cmd = { 'typescript-language-server', '--stdio' },
capabilities = caps capabilities = caps
}) }
-- Java language server support
lspconfig.java_language_server.setup {
capabilities = caps
}
-- Typescript language server support
lspconfig.tsserver.setup {
capabilities = caps
}
-- Rust language server support -- Rust language server support
configure_lsp('rust_analyzer', { lspconfig.rust_analyzer.setup {
settings = { settings = {
-- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc -- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc
['rust-analyzer'] = { ['rust-analyzer'] = {
@ -214,11 +199,10 @@ configure_lsp('rust_analyzer', {
} }
}, },
capabilities = caps capabilities = caps
}) }
-- lua language server setup. -- lua language server setup.
configure_lsp('lua_ls', { lspconfig.lua_ls.setup {
cmd = { 'lua-language-server' },
settings = { settings = {
Lua = { Lua = {
runtime = { version = 'LuaJIT', }, runtime = { version = 'LuaJIT', },
@ -238,13 +222,7 @@ configure_lsp('lua_ls', {
}, },
}, },
capabilities = caps capabilities = caps
}) }
configure_lsp('ty', {
cmd = { 'ty', 'server' },
filetypes = { 'python' },
root_markers = { 'ty.toml', 'pyproject.toml', '.git' },
})
-- lsp configuration -- lsp configuration
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
@ -260,10 +238,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
if client and client.server_capabilities.codelens then if client and client.server_capabilities.codelens then
vim.lsp.codelens.refresh() vim.lsp.codelens.refresh()
end end
-- formatexpr defaulted to the lsp provider by default recently
-- which breaks `gq` and company paragraph formatting in non lsp
-- contexts.
vim.bo[args.buf].formatexpr = ""
end, end,
}) })
@ -281,8 +255,22 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'InsertLeave', 'CursorHold' }, {
}) })
-- LSP Diagnostics Options Setup -- LSP Diagnostics Options Setup
local sign = function(opts)
vim.fn.sign_define(opts.name, {
texthl = opts.name,
text = opts.text,
numhl = ''
})
end
sign({ name = 'DiagnosticSignError', text = '🔥' })
sign({ name = 'DiagnosticSignWarn', text = '⚠️' })
sign({ name = 'DiagnosticSignHint', text = '➡️' })
sign({ name = 'DiagnosticSignInfo', text = '🗒️' })
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = false, virtual_text = false,
signs = true,
update_in_insert = true, update_in_insert = true,
underline = true, underline = true,
severity_sort = false, severity_sort = false,
@ -292,14 +280,6 @@ vim.diagnostic.config({
header = '', header = '',
prefix = '', prefix = '',
}, },
signs = {
text = {
[vim.diagnostic.severity.ERROR] = '🔥',
[vim.diagnostic.severity.WARN] = '⚠️',
[vim.diagnostic.severity.HINT] = '➡️',
[vim.diagnostic.severity.INFO] = '🗒️',
},
}
}) })
vim.cmd([[ vim.cmd([[
@ -340,55 +320,31 @@ require('nvim-treesitter.configs').setup {
extended_mode = true, extended_mode = true,
max_file_lines = nil, max_file_lines = nil,
}, },
textobjects = { --textobjects = {
move = { -- enable = true,
enable = true, -- select = {
set_jumps = true, -- whether to set jumps in the jumplist -- enable = true,
goto_next_start = { -- lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
["]m"] = "@function.outer", -- keymaps = {
["]]"] = { query = "@class.outer", desc = "Next class start" }, -- -- You can use the capture groups defined in textobjects.scm
-- -- ['aa'] = '@parameter.outer',
-- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queries. -- ['ia'] = '@parameter.inner',
["]o"] = "@loop.*", -- ['af'] = '@function.outer',
-- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } -- ['if'] = '@function.inner',
-- -- ['ac'] = '@class.outer',
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path. -- ['ic'] = '@class.inner',
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. -- },
["]s"] = { query = "@local.scope", query_group = "locals", desc = "Next scope" }, -- },
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, --},
}, --incremental_selection = {
goto_next_end = { -- enable = true,
["]M"] = "@function.outer", -- keymaps = {
["]["] = "@class.outer", -- init_selection = '<Leader>c',
}, -- node_incremental = '<Leader>c',
goto_previous_start = { -- scope_incremental = '<Leader>ci',
["[m"] = "@function.outer", -- node_decremental = '<Leader>cx',
["[["] = "@class.outer", -- },
}, --},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
-- Below will go to either the start or the end, whichever is closer.
-- Use if you want more granular movements
-- Make it even more gradual by adding multiple queries and regex.
goto_next = {
["]d"] = "@conditional.outer",
},
goto_previous = {
["[d"] = "@conditional.outer",
}
},
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<Leader>c',
node_incremental = '<Leader>c',
scope_incremental = '<Leader>ci',
node_decremental = '<Leader>cx',
},
},
} }
require 'treesitter-context'.setup { require 'treesitter-context'.setup {
@ -511,6 +467,33 @@ vim.keymap.set("n", "<Leader>ga", function()
vim.cmd("!git add %") vim.cmd("!git add %")
end) end)
require('possession').setup {
commands = {
save = 'SSave',
load = 'SLoad',
delete = 'SDelete',
list = 'SList',
},
autosave = {
current = true,
on_load = true,
on_quit = true,
},
telescope = {
list = {
default_action = 'load',
mappings = {
save = { n = '<c-x>', i = '<c-x>' },
load = { n = '<c-v>', i = '<c-v>' },
delete = { n = '<c-t>', i = '<c-t>' },
rename = { n = '<c-r>', i = '<c-r>' },
},
},
},
}
telescope.load_extension('possession')
-- https://github.com/nvim-telescope/telescope.nvim -- https://github.com/nvim-telescope/telescope.nvim
telescope.setup({ telescope.setup({
defaults = { defaults = {
@ -532,6 +515,9 @@ telescope.setup({
}, },
}) })
local harpoon = require('harpoon')
harpoon:setup()
local lean = require 'lean' local lean = require 'lean'
@ -550,6 +536,7 @@ lean.setup {
} }
-- telescope keymaps -- telescope keymaps
vim.keymap.set("n", "<Leader>pl", telescope.extensions.possession.list)
-- TODO(zaphar): Remove this once my muscle memory has set in. -- TODO(zaphar): Remove this once my muscle memory has set in.
vim.keymap.set("n", "<Leader>nff", telescope_builtins.fd) vim.keymap.set("n", "<Leader>nff", telescope_builtins.fd)
vim.keymap.set("n", "<Leader>ff", telescope_builtins.fd) vim.keymap.set("n", "<Leader>ff", telescope_builtins.fd)
@ -565,6 +552,11 @@ end)
vim.keymap.set("n", "<leader>lds", telescope_builtins.lsp_document_symbols, { desc = "[D]ocument [S]ymbols" }) vim.keymap.set("n", "<leader>lds", telescope_builtins.lsp_document_symbols, { desc = "[D]ocument [S]ymbols" })
vim.keymap.set("n", "<leader>lws", telescope_builtins.lsp_dynamic_workspace_symbols, { desc = "[W]orkspace [S]ymbols" }) vim.keymap.set("n", "<leader>lws", telescope_builtins.lsp_dynamic_workspace_symbols, { desc = "[W]orkspace [S]ymbols" })
-- harpoon keymaps
vim.keymap.set("n", "<Leader>ha", function() harpoon:list():append() end)
vim.keymap.set("n", "<Leader>he", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<Leader>hj", function() harpoon:list():prev() end)
vim.keymap.set("n", "<Leader>hk", function() harpoon:list():next() end)
-- codelens keymaps -- codelens keymaps
vim.keymap.set("n", "<Leader>rr", vim.lsp.codelens.run) vim.keymap.set("n", "<Leader>rr", vim.lsp.codelens.run)
@ -714,7 +706,7 @@ function get_server_list_prompt(hub_instance)
for _, server in ipairs(servers) do for _, server in ipairs(servers) do
mcp_tool_prompt = mcp_tool_prompt .. "## server name: `" .. server.name .. "`\n\n" mcp_tool_prompt = mcp_tool_prompt .. "## server name: `" .. server.name .. "`\n\n"
if server.capabilities and server.capabilities.tools and #server.capabilities.tools > 0 then if server.capabilities.tools and #server.capabilities.tools > 0 then
mcp_tool_prompt = mcp_tool_prompt .. "Available tools:\n\n" mcp_tool_prompt = mcp_tool_prompt .. "Available tools:\n\n"
for _, tool in ipairs(server.capabilities.tools) do for _, tool in ipairs(server.capabilities.tools) do
mcp_tool_prompt = mcp_tool_prompt .. "- tool name: `" .. tool.name .. "`\n" mcp_tool_prompt = mcp_tool_prompt .. "- tool name: `" .. tool.name .. "`\n"
@ -741,37 +733,12 @@ function update_avante_system_prompt()
end end
end end
vim.keymap.set("n", "<Leader>ab", function() require('avante').get().file_selector:add_buffer_files() end) require('copilot').setup();
vim.keymap.set("n", "<Leader>af", function() require('avante').get().file_selector:add_current_buffer() end)
get_root_dir = function()
-- First try to get the root path from LSP
local bufnr = vim.api.nvim_get_current_buf()
local clients = vim.lsp.get_clients({ bufnr = bufnr })
-- Check if we have an active LSP client with a root_dir
for _, client in ipairs(clients) do
if client.config and client.config.root_dir then
return client.config.root_dir
end
end
-- Fall back to file-based detection
local root_file = vim.fs.find(function(name, path)
return name:match('(pyproject.toml|.sln|Cargo.toml|.git)$')
end, { upward = true })[1]
return root_file and vim.fs.dirname(root_file) or vim.fn.getcwd()
end
require('copilot').setup({
root_dir = get_root_dir,
})
require('avante').setup({ require('avante').setup({
provider = "claude", provider = "claude",
mode = "planning",
cursor_applying_provider = nil, -- default to whatever provider is configured cursor_applying_provider = nil, -- default to whatever provider is configured
mode = "agentic",
claude = { claude = {
endpoint = "https://api.anthropic.com", endpoint = "https://api.anthropic.com",
model = "claude-3-7-sonnet-20250219", model = "claude-3-7-sonnet-20250219",
@ -782,15 +749,17 @@ require('avante').setup({
copilot = { copilot = {
model = "claude-3.7-sonnet", model = "claude-3.7-sonnet",
}, },
rag_service = {
enabled = false,
host_mount = os.getenv("HOME"), -- Host mount path for the rag service
provider = "ollama", -- The provider to use for RAG service (e.g. openai or ollama)
llm_model = "llama3", -- The LLM model to use for RAG service
embed_model = "", -- The embedding model to use for RAG service
endpoint = "http://localhost:11434", -- The API endpoint for RAG service
},
behavior = { behavior = {
enable_cursor_planning_mode = true, enable_cursor_planning_mode = true,
}, },
windows = {
ask = {
start_insert=false,
focus_on_apply="theirs",
},
},
system_prompt = make_avante_system_prompt(mcphub.get_hub_instance()), system_prompt = make_avante_system_prompt(mcphub.get_hub_instance()),
custom_tools = { require("mcphub.extensions.avante").mcp_tool() }, custom_tools = { require("mcphub.extensions.avante").mcp_tool() },
-- Disable these because we'll use the mcphub versions instead -- Disable these because we'll use the mcphub versions instead