From 246cb856fd4e0f96d4ec9e31961aec8b327b2b43 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Thu, 16 Dec 2021 21:13:07 +0100 Subject: [PATCH] Add impatient.nvim with automatic cache clearing --- flake.lock | 6 +++--- home.nix | 6 +++++- programs/nvim/default.nix | 2 ++ programs/nvim/plugins.nix | 24 ++++++++++++++++++------ programs/nvim/plugins.txt | 1 + 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 2ae88e0..326923f 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1639644962, - "narHash": "sha256-KapSYcM2r0PyQCAKg5J6rrXkXmw4cItR3jEckH/pAfo=", + "lastModified": 1639683931, + "narHash": "sha256-J4VgfRXxPaSlJMTke+suOzeOw5uYSWDEKSghWzJW5Nk=", "owner": "nix-community", "repo": "home-manager", - "rev": "42ba7b630437ab04b9d97b0745194cd913481051", + "rev": "25e5a900deab645c088ea52d37a5a44c43a639db", "type": "github" }, "original": { diff --git a/home.nix b/home.nix index 34b1a3c..6c735b8 100644 --- a/home.nix +++ b/home.nix @@ -43,7 +43,11 @@ ]; activation = { - reportChanges = lib.hm.dag.entryAnywhere '' + cleanAppCaches = lib.hm.dag.entryAfter [ "onFilesChange" "installPackages" "copyFonts" ] '' + nvim -c 'try | execute "LuaCacheClear" | catch /.*/ | echo "LuaCacheClear not found" | endtry | q' --headless 2> /dev/null + ''; + + reportChanges = lib.hm.dag.entryAfter [ "onFilesChange" "installPackages" "copyFonts" ] '' nix store diff-closures $oldGenPath $newGenPath ''; }; diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index df8309e..e54b0a2 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -13,6 +13,7 @@ in withPython3 = false; extraConfig = '' + lua require('impatient') lua require('nix_init') ''; @@ -38,6 +39,7 @@ in plugins = with customPlugins; [ # Fixes + impatient-nvim FixCursorHold-nvim vim-auto-cursorline diff --git a/programs/nvim/plugins.nix b/programs/nvim/plugins.nix index 84590ae..090353d 100644 --- a/programs/nvim/plugins.nix +++ b/programs/nvim/plugins.nix @@ -1,6 +1,18 @@ # This file has been auto-generated { pkgs, ... }: { + impatient-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "impatient.nvim"; + version = "1636462849"; + src = pkgs.fetchFromGitHub { + owner = "lewis6991"; + repo = "impatient.nvim"; + rev = "282b99b817d61e6c6860addf5629b641925a937a"; + sha256 = "RtXtmtfpPAtZuDSn/eKaX12w1BybqUeWoKVGV2yEMCM="; + fetchSubmodules = false; + }; + meta.homepage = "https://github.com/lewis6991/impatient.nvim"; + }; FixCursorHold-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "FixCursorHold.nvim"; version = "1635853855"; @@ -75,12 +87,12 @@ }; dracula-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "dracula.nvim"; - version = "1638432616"; + version = "1639669370"; src = pkgs.fetchFromGitHub { owner = "Mofiqul"; repo = "dracula.nvim"; - rev = "aa9d195ab856b1c8e9d3afca0768cdc2d992a4a7"; - sha256 = "qRwhrXwpcasr8JC2W7oBiKLsywUzYgSDL8n9rAeQWkk="; + rev = "af0de845997cb7464f816766ee2f291998594829"; + sha256 = "U7D8Onc7aONIQX6AjKHxBakLlzJl9nMPumoR4s68J3c="; fetchSubmodules = false; }; meta.homepage = "https://github.com/Mofiqul/dracula.nvim"; @@ -268,12 +280,12 @@ }; LuaSnip = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "LuaSnip"; - version = "1639652018"; + version = "1639684208"; src = pkgs.fetchFromGitHub { owner = "L3MON4D3"; repo = "LuaSnip"; - rev = "64175a11fc6e8ba81b8f2c6fc93c307f1f34fd43"; - sha256 = "GE82M7ZB4znYFqQ58ii793RFprU+b4gLW8FB7ooR6AA="; + rev = "19ee75526c93fe32facb6bd0e116052280a12929"; + sha256 = "df0/jUn/SkOwbdgBDFawIGYJLNCC+K840EN0uJIsKW0="; fetchSubmodules = false; }; meta.homepage = "https://github.com/L3MON4D3/LuaSnip"; diff --git a/programs/nvim/plugins.txt b/programs/nvim/plugins.txt index d63ea18..88a13bd 100644 --- a/programs/nvim/plugins.txt +++ b/programs/nvim/plugins.txt @@ -1,3 +1,4 @@ +lewis6991/impatient.nvim antoinemadec/FixCursorHold.nvim delphinus/vim-auto-cursorline folke/which-key.nvim