From f5d16c5e87675aef7b1ae6a5f54e8c3924b51ad8 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Tue, 11 Feb 2025 21:27:28 +0100 Subject: [PATCH] programs/editors: add basedpyright-fix for neovim --- modules/programs/editors/default.nix | 2 +- .../programs/editors/neovim/basedpyright-fix.nix | 15 +++++++++++++++ .../editors/{neovim.nix => neovim/default.nix} | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 modules/programs/editors/neovim/basedpyright-fix.nix rename modules/programs/editors/{neovim.nix => neovim/default.nix} (99%) diff --git a/modules/programs/editors/default.nix b/modules/programs/editors/default.nix index f3db4f5..d37ae14 100644 --- a/modules/programs/editors/default.nix +++ b/modules/programs/editors/default.nix @@ -7,7 +7,7 @@ inherit (config.local.systemVars) username; in { imports = [ - ./neovim.nix + ./neovim ]; config = mkIf config.local.profiles.desktop.enable { diff --git a/modules/programs/editors/neovim/basedpyright-fix.nix b/modules/programs/editors/neovim/basedpyright-fix.nix new file mode 100644 index 0000000..331bfbb --- /dev/null +++ b/modules/programs/editors/neovim/basedpyright-fix.nix @@ -0,0 +1,15 @@ +# thanks https://gitlab.com/fazzi/nixohess/-/blob/3e0544761d7f0361e7a8ac7b15714515e7fd5e7c/overlays/basedpyright-fix.nix +_: { + nixpkgs.overlays = [ + (_: prev: { + basedpyright = prev.basedpyright.overrideAttrs (old: { + postInstall = + old.postInstall + + '' + # Remove dangling symlinks created during installation (remove -delete to just see the files, or -print '%l\n' to see the target + find -L $out -type l -print -delete + ''; + }); + }) + ]; +} diff --git a/modules/programs/editors/neovim.nix b/modules/programs/editors/neovim/default.nix similarity index 99% rename from modules/programs/editors/neovim.nix rename to modules/programs/editors/neovim/default.nix index ba5b9ae..e74487d 100644 --- a/modules/programs/editors/neovim.nix +++ b/modules/programs/editors/neovim/default.nix @@ -242,6 +242,7 @@ }; }; in { + imports = [./basedpyright-fix.nix]; config = lib.mkIf config.local.profiles.desktop.enable { hjem.users.${username} = { packages = [customNeovim.neovim];