Compare commits

...

17 Commits

Author SHA1 Message Date
f08f14b09d wip: claude code and avante
This may be a mistake. We'll see.
2025-07-02 14:29:01 -05:00
e02f01f120 wip: add claude code as an option in neovim 2025-07-02 13:06:24 -05:00
f62d99a7f8 fix: update to new flake lockfile update command 2025-07-02 13:00:44 -05:00
8a87841d61 wip: update neovim stuff 2025-07-01 12:06:41 -05:00
8e0951d696 chore: cleanup an old comment 2025-06-30 11:06:37 -05:00
398c2a8291 fix: formatexpr with lsp changed
we need to adapt to it
2025-06-30 10:38:00 -05:00
b254617843 fix: diagnostic signs configuration 2025-06-25 10:00:40 -04:00
e605be817a wip: tree-sitter textobjects 2025-06-25 09:50:16 -04:00
d5bb8c8327 wip: cleanup my sign definition for new version of neovim 2025-06-16 18:48:17 -04:00
cdb41c2b4c cleanup: makefile sudo and unused flakes and packages 2025-06-16 18:47:22 -04:00
550794186a maint: update to 25.05 2025-06-12 18:23:58 -04:00
8bf123d387 fix: fold-level of 3 by default is annoying 2025-06-05 08:43:28 -04:00
44fc4edff5 chore: update some package versions 2025-06-05 08:42:39 -04:00
92685c062d Add some helpful keybinds 2025-05-30 10:42:33 -04:00
0811207844 feat: nvim: treesitter: enable code folding 2025-05-28 18:37:58 -04:00
f8d9064a6d feat: nvim: treesitter: enable incremental selection 2025-05-28 18:00:40 -04:00
f509a2ba87 feat: Update ollama 2025-05-28 17:59:33 -04:00
5 changed files with 257 additions and 352 deletions

View File

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

View File

@ -6,10 +6,11 @@ in
nix = {
package = pkgs.nix;
enable = true;
# SEE: https://github.com/NixOS/nix/issues/4119#issuecomment-1734738812
settings.sandbox = "relaxed";
extraOptions = ''
experimental-features = nix-command flakes repl-flake
experimental-features = nix-command flakes
extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux
trusted-users = root zaphar
'';
@ -347,9 +348,6 @@ in
vfkit
];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
#services.spacebar.enable = true;
#services.spacebar.package = "${pkgs.spacebar}";
@ -365,6 +363,7 @@ in
(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.
# $ darwin-rebuild changelog
system.stateVersion = 4;

View File

@ -20,6 +20,38 @@
"type": "github"
}
},
"avante-src": {
"flake": false,
"locked": {
"lastModified": 1746602870,
"narHash": "sha256-REBOplEe2muqfVLwcpTAmXpTrHlzSfhbh8T0litDTDA=",
"owner": "yetone",
"repo": "avante.nvim",
"rev": "113913355a6b9c0fbd62cf52d0cf3e5671d0e34a",
"type": "github"
},
"original": {
"owner": "yetone",
"repo": "avante.nvim",
"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": {
"inputs": {
"flake-compat": "flake-compat",
@ -46,6 +78,8 @@
},
"custom-flakes": {
"inputs": {
"avante-src": "avante-src",
"claude-code-nvim-src": "claude-code-nvim-src",
"d2-vim-src": "d2-vim-src",
"flake-utils": "flake-utils_3",
"gomod2nix-src": "gomod2nix-src",
@ -62,16 +96,14 @@
"rust-overlay": "rust-overlay_3",
"tree-sitter-cli-src": "tree-sitter-cli-src",
"treesitter-context": "treesitter-context",
"victoria-logs-src": "victoria-logs-src",
"victoria-metrics-src": "victoria-metrics-src",
"zig-src": "zig-src"
},
"locked": {
"lastModified": 1746458473,
"narHash": "sha256-3FFhJ18MJFlHHI1YaMKRwXURcQjmLenxIcLFtr+CjGI=",
"lastModified": 1751479151,
"narHash": "sha256-JxS2yHOiScQQOk8YvK4UAGx68iQJXKnL5qNvV0+9s9A=",
"owner": "zaphar",
"repo": "nix-flakes",
"rev": "91588e10769e706024d8d03ebb4958c89e00c264",
"rev": "0442ff179bd8e82ca3fe713d22e258c89f9caccc",
"type": "github"
},
"original": {
@ -141,15 +173,16 @@
]
},
"locked": {
"lastModified": 1715871485,
"narHash": "sha256-ywapEXmBBI+DVRx/YYC6+6Lk+W8vhShz1uJNvqPKzng=",
"lastModified": 1749744770,
"narHash": "sha256-MEM9XXHgBF/Cyv1RES1t6gqAX7/tvayBC1r/KPyK1ls=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "cb02884fa1ff5a619a44ab5f1bcc4dedd2d623c2",
"rev": "536f951efb1ccda9b968e3c9dee39fbeb6d3fdeb",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "nix-darwin-25.05",
"repo": "nix-darwin",
"type": "github"
}
@ -297,24 +330,6 @@
"inputs": {
"systems": "systems_9"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_11": {
"inputs": {
"systems": "systems_10"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
@ -329,7 +344,7 @@
"type": "github"
}
},
"flake-utils_12": {
"flake-utils_11": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
@ -344,9 +359,9 @@
"type": "github"
}
},
"flake-utils_13": {
"flake-utils_12": {
"inputs": {
"systems": "systems_11"
"systems": "systems_10"
},
"locked": {
"lastModified": 1705309234,
@ -362,9 +377,9 @@
"type": "github"
}
},
"flake-utils_14": {
"flake-utils_13": {
"inputs": {
"systems": "systems_12"
"systems": "systems_11"
},
"locked": {
"lastModified": 1726560853,
@ -380,9 +395,9 @@
"type": "github"
}
},
"flake-utils_15": {
"flake-utils_14": {
"inputs": {
"systems": "systems_13"
"systems": "systems_12"
},
"locked": {
"lastModified": 1681202837,
@ -579,23 +594,6 @@
"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": {
"inputs": {
"flake-compat": "flake-compat_3",
@ -678,11 +676,11 @@
"rust-overlay": "rust-overlay_5"
},
"locked": {
"lastModified": 1737911819,
"narHash": "sha256-EsxRZIwe1EaacXj3yp1xo2pqHufr/ZLaqOPnsOmEmI0=",
"lastModified": 1749118509,
"narHash": "sha256-HKqpDREmzpCskJdfUwvUMJwHTx1RHL7/XMJMUDDMVJA=",
"owner": "martinvonz",
"repo": "jj",
"rev": "00069119d8165c9c9b3b176c00c3171c73c05138",
"rev": "0dc9eb5187b79e3722d20f3c5e2c584edb501e1a",
"type": "github"
},
"original": {
@ -801,7 +799,7 @@
},
"naersk_5": {
"inputs": {
"nixpkgs": "nixpkgs_16"
"nixpkgs": "nixpkgs_15"
},
"locked": {
"lastModified": 1650101877,
@ -819,7 +817,7 @@
},
"naersk_6": {
"inputs": {
"nixpkgs": "nixpkgs_17"
"nixpkgs": "nixpkgs_16"
},
"locked": {
"lastModified": 1721727458,
@ -867,28 +865,6 @@
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils_10",
"nixpkgs": "nixpkgs_12"
},
"locked": {
"dir": "contrib",
"lastModified": 1715862872,
"narHash": "sha256-FCOipXHkAbkuFw9JjEpOIJ8BkyMkjkI0Dp+SzZ4yZlw=",
"owner": "neovim",
"repo": "neovim",
"rev": "27fb62988e922c2739035f477f93cc052a4fee1e",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"ref": "stable",
"repo": "neovim",
"type": "github"
}
},
"nil-flake": {
"inputs": {
"flake-utils": "flake-utils_5",
@ -911,8 +887,8 @@
},
"nil-flake_2": {
"inputs": {
"flake-utils": "flake-utils_11",
"nixpkgs": "nixpkgs_13",
"flake-utils": "flake-utils_10",
"nixpkgs": "nixpkgs_12",
"rust-overlay": "rust-overlay_6"
},
"locked": {
@ -947,27 +923,27 @@
},
"nixpkgs-darwin": {
"locked": {
"lastModified": 1735564410,
"narHash": "sha256-HB/FA0+1gpSs8+/boEavrGJH+Eq08/R2wWNph1sM1Dg=",
"lastModified": 1749596380,
"narHash": "sha256-7DEKr2x/jIAKkwHPNNjG6lGUz9nk8SGrbyaeAFMtN34=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1e7a8f391f1a490460760065fa0630b5520f9cf8",
"rev": "210a4a2e3d3853be3a6017e68d2897771fdace35",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-24.05-darwin",
"ref": "nixpkgs-25.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1737557748,
"narHash": "sha256-BaMuhctP1x00+8cBE2cJveJQb70/tWHI50MHj/ZrtOY=",
"lastModified": 1747920628,
"narHash": "sha256-IlAuXnIi+ZmyS89tt1YOFDCv7FKs9bNBHd3MXMp8PxE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "606996d74f6e2a12635d41c1bf58bfc7ea3bb5ec",
"rev": "e314d5c6d3b3a0f40ec5bcbc007b0cbe412f48ae",
"type": "github"
},
"original": {
@ -994,22 +970,6 @@
}
},
"nixpkgs_12": {
"locked": {
"lastModified": 1715787315,
"narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_13": {
"locked": {
"lastModified": 1690441914,
"narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=",
@ -1025,23 +985,23 @@
"type": "github"
}
},
"nixpkgs_14": {
"nixpkgs_13": {
"locked": {
"lastModified": 1738579205,
"narHash": "sha256-o6BeeanSUALvz8oL2CHOikVjCf7j+HqlA0WGvKOUX3Q=",
"lastModified": 1749747690,
"narHash": "sha256-FPhMfYq+ngKpZiYaOblqR6S9z9JVpTlW8EaQ98xwkkU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "be5cf18b3d26ba2db938a72ade93ac8a9a7462ff",
"rev": "f7d4856c2d1af130193777964535304fdc76e368",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-24.11",
"ref": "release-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_15": {
"nixpkgs_14": {
"locked": {
"lastModified": 1689850295,
"narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=",
@ -1057,7 +1017,7 @@
"type": "github"
}
},
"nixpkgs_16": {
"nixpkgs_15": {
"locked": {
"lastModified": 1650109093,
"narHash": "sha256-tqlnKrAdJktRLXTou9le0oTqrYBAFpGscV5RADdpArU=",
@ -1071,6 +1031,20 @@
"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": {
"locked": {
"lastModified": 1729658218,
@ -1086,20 +1060,6 @@
}
},
"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": {
"lastModified": 1682109806,
"narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=",
@ -1253,7 +1213,7 @@
},
"nurl-flake_2": {
"inputs": {
"nixpkgs": "nixpkgs_15"
"nixpkgs": "nixpkgs_14"
},
"locked": {
"lastModified": 1701273941,
@ -1277,14 +1237,12 @@
"d2-vim-src": "d2-vim-src_2",
"darwin": "darwin_2",
"durnitisp-flake": "durnitisp-flake",
"harpoon-src": "harpoon-src",
"heracles-flake": "heracles-flake",
"jujutsu-flake": "jujutsu-flake",
"mcphub-flake": "mcphub-flake",
"neogit-src": "neogit-src_2",
"neovim-flake": "neovim-flake",
"nil-flake": "nil-flake_2",
"nixpkgs": "nixpkgs_14",
"nixpkgs": "nixpkgs_13",
"nixpkgs-darwin": "nixpkgs-darwin",
"nurl-flake": "nurl-flake_2",
"roslyn-lsp": "roslyn-lsp_2",
@ -1292,7 +1250,6 @@
"rust-overlay-flake": "rust-overlay-flake",
"sheetsui-flake": "sheetsui-flake",
"sile-flake": "sile-flake",
"treesitter-context": "treesitter-context_2",
"unstable": "unstable"
}
},
@ -1333,7 +1290,7 @@
"runwhen-flake": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_12",
"flake-utils": "flake-utils_11",
"naersk": "naersk_5"
},
"locked": {
@ -1375,7 +1332,7 @@
},
"rust-overlay-flake": {
"inputs": {
"flake-utils": "flake-utils_13",
"flake-utils": "flake-utils_12",
"nixpkgs": [
"nixpkgs"
]
@ -1469,11 +1426,11 @@
]
},
"locked": {
"lastModified": 1737685583,
"narHash": "sha256-p+NVABRpGi+pT+xxf9HcLcFVxG6L+vEEy+NwzB9T0f8=",
"lastModified": 1747967795,
"narHash": "sha256-76s4jDRbQzxRO+5y8ilMp5V30qVgY9R6n8U7aOap8ig=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "eb64cbcc8eee0fa87ebded92805280d2ec97415a",
"rev": "f1d5bfa8c692cacd798a3e1fb93d54c1b9ac701a",
"type": "github"
},
"original": {
@ -1530,9 +1487,9 @@
},
"sheetsui-flake": {
"inputs": {
"flake-utils": "flake-utils_14",
"flake-utils": "flake-utils_13",
"naersk": "naersk_6",
"nixpkgs": "nixpkgs_18",
"nixpkgs": "nixpkgs_17",
"rust-overlay": "rust-overlay_7"
},
"locked": {
@ -1552,10 +1509,10 @@
"sile-flake": {
"inputs": {
"flake-compat": "flake-compat_5",
"flake-utils": "flake-utils_15",
"flake-utils": "flake-utils_14",
"gitignore": "gitignore",
"libtexpdf-src": "libtexpdf-src",
"nixpkgs": "nixpkgs_19"
"nixpkgs": "nixpkgs_18"
},
"locked": {
"lastModified": 1694595810,
@ -1631,21 +1588,6 @@
"type": "github"
}
},
"systems_13": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
@ -1799,30 +1741,13 @@
"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": {
"locked": {
"lastModified": 1746152631,
"narHash": "sha256-zBuvmL6+CUsk2J8GINpyy8Hs1Zp4PP6iBWSmZ4SCQ/s=",
"lastModified": 1751349533,
"narHash": "sha256-5XRh0mB06/7WYDLu9ZXsx1GhyvvNVZDtPyg34sUCLJs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "032bc6539bd5f14e9d0c51bd79cfe9a055b094c3",
"rev": "bdfd0f2afcf764e531d0960c821ab070a6174b15",
"type": "github"
},
"original": {
@ -1830,40 +1755,6 @@
"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": {
"flake": false,
"locked": {

View File

@ -1,15 +1,15 @@
{
inputs = {
# Default to sane nixpkgs versions
nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
nixpkgs.url = "github:nixos/nixpkgs/release-25.05";
unstable.url = "nixpkgs";
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin";
#lean4-flake = {
# url = "github:leanprover/lean4/v4.4.0";
# inputs.nixpkgs.follows = "nixpkgs";
#};
darwin = {
url = "github:lnl7/nix-darwin";
url = "github:lnl7/nix-darwin/nix-darwin-25.05";
# ensure that darwinSystem uses our nixpkgs version
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
@ -31,20 +31,16 @@
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-flake = {
url = "github:neovim/neovim/stable?dir=contrib";
# NOTE(jeremy): Currently this needs a newer nixpkgs version
#inputs.nixpkgs.follows = "nixpkgs";
};
#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";
custom-flakes = {
url = "github:zaphar/nix-flakes";
inputs.nixpkgs.follows = "nixpkgs";
};
harpoon-src = {
url = "github:ThePrimeagen/harpoon/harpoon2";
flake = false;
};
neogit-src = {
url = "github:NeogitOrg/neogit";
flake = false;
@ -53,11 +49,6 @@
url = "github:terrastruct/d2-vim";
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 = {
url = "github:zaphar/roslyn.nvim/main";
flake = false;
@ -76,11 +67,9 @@
agenix-flake,
nil-flake,
nurl-flake,
harpoon-src,
custom-flakes,
unstable,
heracles-flake,
neovim-flake,
clio-flake,
sheetsui-flake,
mcphub-flake,
@ -90,27 +79,18 @@
vimModule = system: let
nil-pkg = nil-flake.packages."${system}".default;
mcp-hub-binary = custom-flakes.packages."${system}".mcp-hub;
claude-code-binary = custom-flakes.packages."${system}".claude-code;
in
{ config, pkgs, ...}: let
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;
d2-vim = custom-flakes.packages."${system}".d2-vim;
hunk-nvim = custom-flakes.packages."${system}".hunk-nvim;
# TODO(zaphar): Apparently this is a remote plugin so it needs some additional love.
#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;
ionide-nvim = custom-flakes.packages."${system}".ionide-nvim;
nvim = neovim-flake.packages."${system}".neovim;
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
# for csharp
#tree-sitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix {
@ -137,17 +117,14 @@
nixpkgs.overlays = [
(final: prev: {
custom-neovim = nvim;
lorri = unstablePkgs.lorri;
avante-nvim = unstablePkgs.vimPlugins.avante-nvim;
copilot-lua = unstablePkgs.vimPlugins.copilot-lua;
})
];
programs = with pkgs; {
programs = with unstablePkgs; {
neovim.enable = true;
neovim.vimAlias = true;
neovim.viAlias = true;
neovim.package = pkgs.custom-neovim;
neovim.package = unstablePkgs.neovim-unwrapped;
neovim.configure = {
customRC = "lua << EOF
${builtins.readFile ./init.lua}
@ -224,9 +201,8 @@ EOF";
vim-dasht
direnv-vim
mcphub-nvim
claude-code-nvim
]) ++ [
possession-nvim
harpoon-nvim
d2-vim
hunk-nvim
neogit-nvim
@ -237,9 +213,9 @@ EOF";
};
environment.systemPackages = (with pkgs; [
terraform-ls
tinymist
nodePackages.typescript-language-server
nodePackages.jsdoc
python312Packages.jedi-language-server
# TODO find a version of the julia package that will install
# on darwin and add it as an overlay
nil-pkg
@ -251,6 +227,7 @@ EOF";
devenv
unstablePkgs.fq
mcp-hub-binary
claude-code-binary
]);
};
};
@ -292,6 +269,7 @@ EOF";
uv = unstablePkgs.uv;
quint = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint";
quint-lsp = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint-language-server";
ollama = unstablePkgs.ollama;
})
rust-overlay
];
@ -318,13 +296,11 @@ EOF";
};
};
environment.systemPackages = (with pkgs; [
isabelle
sheetsui
lean4
quint
quint-lsp
terraform # TODO(jeremy): Replace with opentofu when that is an option.
nomad
oha
nodejs
gnumake

View File

@ -20,6 +20,10 @@ vim.opt.fileformats = "unix,dos"
-- Recommended by Avante docs
-- views can only be fully collapsed with the global statusline
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_AuthorRef = 'jw'
@ -43,6 +47,23 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
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([[
au BufNewFile,BufRead *Makefile,*.mk set noexpandtab
]])
@ -147,23 +168,26 @@ local caps = vim.tbl_deep_extend(
local lspconfig = require("lspconfig")
local configure_lsp = function(name, config)
vim.lsp.enable(name)
vim.lsp.config(name, config)
end
-- Typst
lspconfig.tinymist.setup {
configure_lsp('tinymist', {
capabilities = caps,
settings = {
exportPdf = "onSave",
},
}
})
-- Terraform lsp setup
lspconfig.terraformls.setup {}
configure_lsp('terraformls', {})
-- Nix language server support
lspconfig.nil_ls.setup {
configure_lsp('nil_ls', {
capabilities = caps,
}
lspconfig.jedi_language_server.setup {}
})
require('roslyn').setup({
-- client, bufnr
@ -175,23 +199,14 @@ require('roslyn').setup({
log_level = "Trace",
});
--ocaml
lspconfig.ocamllsp.setup {
capabilities = caps
}
-- Java language server support
lspconfig.java_language_server.setup {
capabilities = caps
}
-- Typescript language server support
lspconfig.tsserver.setup {
configure_lsp('tsserver', {
cmd = { 'typescript-language-server', '--stdio' },
capabilities = caps
}
})
-- Rust language server support
lspconfig.rust_analyzer.setup {
configure_lsp('rust_analyzer', {
settings = {
-- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc
['rust-analyzer'] = {
@ -199,10 +214,11 @@ lspconfig.rust_analyzer.setup {
}
},
capabilities = caps
}
})
-- lua language server setup.
lspconfig.lua_ls.setup {
configure_lsp('lua_ls', {
cmd = { 'lua-language-server' },
settings = {
Lua = {
runtime = { version = 'LuaJIT', },
@ -222,7 +238,13 @@ lspconfig.lua_ls.setup {
},
},
capabilities = caps
}
})
configure_lsp('ty', {
cmd = { 'ty', 'server' },
filetypes = { 'python' },
root_markers = { 'ty.toml', 'pyproject.toml', '.git' },
})
-- lsp configuration
vim.api.nvim_create_autocmd('LspAttach', {
@ -238,6 +260,10 @@ vim.api.nvim_create_autocmd('LspAttach', {
if client and client.server_capabilities.codelens then
vim.lsp.codelens.refresh()
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,
})
@ -255,22 +281,8 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'InsertLeave', 'CursorHold' }, {
})
-- 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({
virtual_text = false,
signs = true,
update_in_insert = true,
underline = true,
severity_sort = false,
@ -280,6 +292,14 @@ vim.diagnostic.config({
header = '',
prefix = '',
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = '🔥',
[vim.diagnostic.severity.WARN] = '⚠️',
[vim.diagnostic.severity.HINT] = '➡️',
[vim.diagnostic.severity.INFO] = '🗒️',
},
}
})
vim.cmd([[
@ -320,31 +340,55 @@ require('nvim-treesitter.configs').setup {
extended_mode = true,
max_file_lines = nil,
},
--textobjects = {
-- enable = true,
-- select = {
-- enable = true,
-- lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
-- keymaps = {
-- -- You can use the capture groups defined in textobjects.scm
-- ['aa'] = '@parameter.outer',
-- ['ia'] = '@parameter.inner',
-- ['af'] = '@function.outer',
-- ['if'] = '@function.inner',
-- ['ac'] = '@class.outer',
-- ['ic'] = '@class.inner',
-- },
-- },
--},
--incremental_selection = {
-- enable = true,
-- keymaps = {
-- init_selection = '<Leader>c',
-- node_incremental = '<Leader>c',
-- scope_incremental = '<Leader>ci',
-- node_decremental = '<Leader>cx',
-- },
--},
textobjects = {
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = { query = "@class.outer", desc = "Next class start" },
--
-- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queries.
["]o"] = "@loop.*",
-- ["]o"] = { query = { "@loop.inner", "@loop.outer" } }
--
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
-- 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" },
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@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 {
@ -467,33 +511,6 @@ vim.keymap.set("n", "<Leader>ga", function()
vim.cmd("!git add %")
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
telescope.setup({
defaults = {
@ -515,9 +532,6 @@ telescope.setup({
},
})
local harpoon = require('harpoon')
harpoon:setup()
local lean = require 'lean'
@ -536,7 +550,6 @@ lean.setup {
}
-- telescope keymaps
vim.keymap.set("n", "<Leader>pl", telescope.extensions.possession.list)
-- 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>ff", telescope_builtins.fd)
@ -552,11 +565,6 @@ end)
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" })
-- 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
vim.keymap.set("n", "<Leader>rr", vim.lsp.codelens.run)
@ -706,7 +714,7 @@ function get_server_list_prompt(hub_instance)
for _, server in ipairs(servers) do
mcp_tool_prompt = mcp_tool_prompt .. "## server name: `" .. server.name .. "`\n\n"
if server.capabilities.tools and #server.capabilities.tools > 0 then
if server.capabilities and server.capabilities.tools and #server.capabilities.tools > 0 then
mcp_tool_prompt = mcp_tool_prompt .. "Available tools:\n\n"
for _, tool in ipairs(server.capabilities.tools) do
mcp_tool_prompt = mcp_tool_prompt .. "- tool name: `" .. tool.name .. "`\n"
@ -733,7 +741,32 @@ function update_avante_system_prompt()
end
end
require('copilot').setup();
vim.keymap.set("n", "<Leader>ab", function() require('avante').get().file_selector:add_buffer_files() end)
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({
provider = "claude",
@ -752,6 +785,12 @@ require('avante').setup({
behavior = {
enable_cursor_planning_mode = true,
},
windows = {
ask = {
start_insert=false,
focus_on_apply="theirs",
},
},
system_prompt = make_avante_system_prompt(mcphub.get_hub_instance()),
custom_tools = { require("mcphub.extensions.avante").mcp_tool() },
-- Disable these because we'll use the mcphub versions instead