From 74fb7a2b4ca8a4b84402cf59804bf1b2a57b84aa Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Mon, 5 May 2025 12:56:57 -0400 Subject: [PATCH] wip: using custom-flakes implementation --- nix/base-system/flake.lock | 304 ++++++++++++++++++++++++++++--------- nix/base-system/flake.nix | 65 ++++---- nix/base-system/init.lua | 10 +- 3 files changed, 271 insertions(+), 108 deletions(-) diff --git a/nix/base-system/flake.lock b/nix/base-system/flake.lock index cac9864..539ecc6 100644 --- a/nix/base-system/flake.lock +++ b/nix/base-system/flake.lock @@ -20,6 +20,22 @@ "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" + } + }, "clio-flake": { "inputs": { "flake-compat": "flake-compat", @@ -46,6 +62,7 @@ }, "custom-flakes": { "inputs": { + "avante-src": "avante-src", "d2-vim-src": "d2-vim-src", "flake-utils": "flake-utils_3", "gomod2nix-src": "gomod2nix-src", @@ -67,11 +84,11 @@ "zig-src": "zig-src" }, "locked": { - "lastModified": 1746458473, - "narHash": "sha256-3FFhJ18MJFlHHI1YaMKRwXURcQjmLenxIcLFtr+CjGI=", + "lastModified": 1746633381, + "narHash": "sha256-9Vgnz0/Myw+XdZUxNWYhfdfRzz1SSDQIFjrhaXFcJpk=", "owner": "zaphar", "repo": "nix-flakes", - "rev": "91588e10769e706024d8d03ebb4958c89e00c264", + "rev": "30a4fb242f5e6542b842be1972d953d20945ed7a", "type": "github" }, "original": { @@ -223,6 +240,38 @@ } }, "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, "locked": { "lastModified": 1648199409, @@ -238,7 +287,7 @@ "type": "github" } }, - "flake-compat_5": { + "flake-compat_7": { "flake": false, "locked": { "lastModified": 1673956053, @@ -275,6 +324,48 @@ "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": { "inputs": { "systems": "systems" @@ -297,24 +388,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 +402,7 @@ "type": "github" } }, - "flake-utils_12": { + "flake-utils_11": { "locked": { "lastModified": 1649676176, "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", @@ -344,9 +417,9 @@ "type": "github" } }, - "flake-utils_13": { + "flake-utils_12": { "inputs": { - "systems": "systems_11" + "systems": "systems_10" }, "locked": { "lastModified": 1705309234, @@ -362,9 +435,9 @@ "type": "github" } }, - "flake-utils_14": { + "flake-utils_13": { "inputs": { - "systems": "systems_12" + "systems": "systems_11" }, "locked": { "lastModified": 1726560853, @@ -380,9 +453,9 @@ "type": "github" } }, - "flake-utils_15": { + "flake-utils_14": { "inputs": { - "systems": "systems_13" + "systems": "systems_12" }, "locked": { "lastModified": 1681202837, @@ -539,7 +612,52 @@ "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": { + "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": { "nixpkgs": [ "sile-flake", @@ -618,6 +736,28 @@ "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": { "inputs": { "nixpkgs": [ @@ -867,24 +1007,42 @@ "type": "github" } }, - "neovim-flake": { + "neovim-nightly-overlay": { "inputs": { - "flake-utils": "flake-utils_10", - "nixpkgs": "nixpkgs_12" + "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": { - "dir": "contrib", - "lastModified": 1715862872, - "narHash": "sha256-FCOipXHkAbkuFw9JjEpOIJ8BkyMkjkI0Dp+SzZ4yZlw=", - "owner": "neovim", - "repo": "neovim", - "rev": "27fb62988e922c2739035f477f93cc052a4fee1e", + "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": { - "dir": "contrib", "owner": "neovim", - "ref": "stable", "repo": "neovim", "type": "github" } @@ -911,7 +1069,7 @@ }, "nil-flake_2": { "inputs": { - "flake-utils": "flake-utils_11", + "flake-utils": "flake-utils_10", "nixpkgs": "nixpkgs_13", "rust-overlay": "rust-overlay_6" }, @@ -995,16 +1153,16 @@ }, "nixpkgs_12": { "locked": { - "lastModified": 1715787315, - "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", - "owner": "nixos", + "lastModified": 1746576598, + "narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -1282,7 +1440,7 @@ "jujutsu-flake": "jujutsu-flake", "mcphub-flake": "mcphub-flake", "neogit-src": "neogit-src_2", - "neovim-flake": "neovim-flake", + "neovim-nightly-overlay": "neovim-nightly-overlay", "nil-flake": "nil-flake_2", "nixpkgs": "nixpkgs_14", "nixpkgs-darwin": "nixpkgs-darwin", @@ -1332,8 +1490,8 @@ }, "runwhen-flake": { "inputs": { - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_12", + "flake-compat": "flake-compat_6", + "flake-utils": "flake-utils_11", "naersk": "naersk_5" }, "locked": { @@ -1375,7 +1533,7 @@ }, "rust-overlay-flake": { "inputs": { - "flake-utils": "flake-utils_13", + "flake-utils": "flake-utils_12", "nixpkgs": [ "nixpkgs" ] @@ -1530,7 +1688,7 @@ }, "sheetsui-flake": { "inputs": { - "flake-utils": "flake-utils_14", + "flake-utils": "flake-utils_13", "naersk": "naersk_6", "nixpkgs": "nixpkgs_18", "rust-overlay": "rust-overlay_7" @@ -1551,9 +1709,9 @@ }, "sile-flake": { "inputs": { - "flake-compat": "flake-compat_5", - "flake-utils": "flake-utils_15", - "gitignore": "gitignore", + "flake-compat": "flake-compat_7", + "flake-utils": "flake-utils_14", + "gitignore": "gitignore_2", "libtexpdf-src": "libtexpdf-src", "nixpkgs": "nixpkgs_19" }, @@ -1631,21 +1789,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, @@ -1782,6 +1925,27 @@ "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": { "flake": false, "locked": { diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index bc0000e..7267fd4 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -30,12 +30,7 @@ url = "github:oxalica/rust-overlay"; 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-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; jujutsu-flake.url = "github:martinvonz/jj"; custom-flakes = { url = "github:zaphar/nix-flakes"; @@ -80,7 +75,7 @@ custom-flakes, unstable, heracles-flake, - neovim-flake, + neovim-nightly-overlay, clio-flake, sheetsui-flake, mcphub-flake, @@ -90,6 +85,7 @@ vimModule = system: let nil-pkg = nil-flake.packages."${system}".default; mcp-hub-binary = custom-flakes.packages."${system}".mcp-hub; + notion-mcp-server = custom-flakes.packages."${system}".notion-mcp-server; in { config, pkgs, ...}: let unstablePkgs = import unstable { inherit system; }; @@ -110,7 +106,6 @@ 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; # 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 { @@ -124,38 +119,15 @@ # inherit (pkgs) fetchFromGitHub; #}; mcphub-nvim = mcphub-flake.packages."${system}".default; - in { - imports = [ - ./program-neovim.nix - ]; - config = { - environment.variables = { - EDITOR="nvim"; - PAGER="less -R"; - OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp"; - }; - - 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; { - neovim.enable = true; - neovim.vimAlias = true; - neovim.viAlias = true; - neovim.package = pkgs.custom-neovim; - neovim.configure = { - customRC = "lua << EOF + my-neovim = pkgs.wrapNeovim unstablePkgs.neovim-unwrapped { + configure = { + customRC = "lua << EOF ${builtins.readFile ./init.lua} EOF"; - packages.myVimPackage = { + packages.myPlugins = { start = (with pkgs.vimPlugins; [ copilot-lua - avante-nvim + custom-flakes.packages."${system}".avante-nvim vim-sile nvim-tree-lua nvim-lspconfig @@ -232,9 +204,26 @@ EOF"; neogit-nvim # 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; [ terraform-ls nodePackages.typescript-language-server @@ -251,6 +240,8 @@ EOF"; devenv unstablePkgs.fq mcp-hub-binary + notion-mcp-server + my-neovim ]); }; }; diff --git a/nix/base-system/init.lua b/nix/base-system/init.lua index 12623c9..eb6425c 100644 --- a/nix/base-system/init.lua +++ b/nix/base-system/init.lua @@ -737,8 +737,8 @@ require('copilot').setup(); require('avante').setup({ provider = "claude", - mode = "planning", cursor_applying_provider = nil, -- default to whatever provider is configured + mode = "agentic", claude = { endpoint = "https://api.anthropic.com", model = "claude-3-7-sonnet-20250219", @@ -749,6 +749,14 @@ require('avante').setup({ copilot = { 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 = { enable_cursor_planning_mode = true, },