From 611371b56fc7fc4423d2c92bd8109c261fe2edfb Mon Sep 17 00:00:00 2001 From: uku Date: Thu, 17 Apr 2025 11:09:39 +0200 Subject: [PATCH] feat(programs/neovim): we getchoo. neovim. wrapper. --- configs/client.nix | 1 - configs/common.nix | 6 +--- flake.lock | 21 ++++++++++++ flake.nix | 5 +++ programs/neovim/default.nix | 67 +++++++++++++++++++++---------------- 5 files changed, 66 insertions(+), 34 deletions(-) diff --git a/configs/client.nix b/configs/client.nix index caf0ff3..88cc846 100644 --- a/configs/client.nix +++ b/configs/client.nix @@ -7,7 +7,6 @@ imports = [ ./common.nix - ../programs/neovim ../programs/rust.nix ]; diff --git a/configs/common.nix b/configs/common.nix index b72b726..a0dbfd6 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -31,6 +31,7 @@ in ../programs/fish.nix ../programs/git.nix + ../programs/neovim ]; age = { @@ -154,11 +155,6 @@ in enable = true; enableFishIntegration = true; }; - - neovim = { - enable = true; - defaultEditor = true; - }; }; security = { diff --git a/flake.lock b/flake.lock index 8209bce..8e22414 100644 --- a/flake.lock +++ b/flake.lock @@ -125,6 +125,26 @@ "type": "github" } }, + "getchvim": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744833748, + "narHash": "sha256-+kB8uBposUKOLL9wNOVySacNERmt0HOasg950YA0p94=", + "owner": "getchoo", + "repo": "getchvim", + "rev": "47f72d2e178a4b0d01ef7b1f9a742a86b4eb5dd8", + "type": "github" + }, + "original": { + "owner": "getchoo", + "repo": "getchvim", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -242,6 +262,7 @@ "crane": "crane", "flake-parts": "flake-parts", "flake-utils": "flake-utils", + "getchvim": "getchvim", "home-manager": "home-manager", "lanzaboote": "lanzaboote", "mystia": "mystia", diff --git a/flake.nix b/flake.nix index 268b96a..15613a7 100644 --- a/flake.nix +++ b/flake.nix @@ -84,6 +84,11 @@ inputs.systems.follows = "systems"; }; + getchvim = { + url = "github:getchoo/getchvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/programs/neovim/default.nix b/programs/neovim/default.nix index f327378..c939db1 100644 --- a/programs/neovim/default.nix +++ b/programs/neovim/default.nix @@ -1,34 +1,45 @@ -{ pkgs, ... }: { - hm.programs.neovim = { - enable = true; - defaultEditor = true; - extraLuaConfig = builtins.readFile ./init.lua; + pkgs, + getchvim, + ... +}: +let + inherit (pkgs.stdenv.hostPlatform) system; + inherit (getchvim.packages.${system}.getchvim) makeNeovimWrapper; +in +{ + environment = { + variables.EDITOR = "nvim"; + systemPackages = [ + (makeNeovimWrapper { + pname = "ukuvim"; - extraPackages = with pkgs; [ - lua5_1 - nixfmt-rfc-style - tree-sitter - ]; + luaRc = ./init.lua; - plugins = with pkgs.vimPlugins; [ - barbar-nvim - catppuccin-nvim - cmp-async-path - cmp-buffer - cmp-nvim-lsp - direnv-vim - fidget-nvim - gitsigns-nvim - lsp-format-nvim - lualine-nvim - neo-tree-nvim - nvim-autopairs - nvim-cmp - nvim-lspconfig - nvim-treesitter.withAllGrammars - nvim-web-devicons # for lualine - vim-wakatime + runtimePrograms = with pkgs; [ + nixfmt-rfc-style + ]; + + vimPluginPackages = with pkgs.vimPlugins; [ + barbar-nvim + catppuccin-nvim + cmp-async-path + cmp-buffer + cmp-nvim-lsp + direnv-vim + fidget-nvim + gitsigns-nvim + lsp-format-nvim + lualine-nvim + neo-tree-nvim + nvim-autopairs + nvim-cmp + nvim-lspconfig + nvim-treesitter.withAllGrammars + nvim-web-devicons # for lualine + vim-wakatime + ]; + }) ]; }; }