diff --git a/lib/plugins/mk-neovim-plugin.nix b/lib/plugins/mk-neovim-plugin.nix index 9fe94bc7..cce52648 100644 --- a/lib/plugins/mk-neovim-plugin.nix +++ b/lib/plugins/mk-neovim-plugin.nix @@ -20,7 +20,6 @@ # For example, they might just be configured through some other mean, like global variables hasLuaConfig ? true, # options - packPathName ? name, # Can be a string, a list of strings, or a module option: # - A string will be intrpreted as `pkgs.vimPlugins.${package}` # - A list will be interpreted as a "pkgs path", e.g. `pkgs.${elem1}.${elem2}.${etc...}` @@ -66,9 +65,9 @@ let { options = lib.setAttrByPath loc ( { - enable = lib.mkEnableOption packPathName; - autoLoad = lib.nixvim.mkAutoLoadOption cfg packPathName; - lazyLoad = lib.nixvim.mkLazyLoadOption packPathName; + enable = lib.mkEnableOption name; + autoLoad = lib.nixvim.mkAutoLoadOption cfg name; + lazyLoad = lib.nixvim.mkLazyLoadOption name; } // lib.optionalAttrs hasSettings { settings = lib.nixvim.mkSettingsOption { @@ -114,7 +113,7 @@ let assertions = [ { assertion = (isColorscheme && colorscheme != null) || cfg.lazyLoad.settings != { }; - message = "You have enabled lazy loading for ${packPathName} but have not provided any configuration."; + message = "You have enabled lazy loading for ${name} but have not provided any configuration."; } ]; @@ -122,7 +121,8 @@ let plugins = [ ( { - __unkeyed-1 = packPathName; + # The packpath name is always the derivation name + __unkeyed-1 = lib.getName cfg.package; # Use provided after, otherwise fallback to normal function wrapped lua content after = let @@ -162,7 +162,7 @@ in imports ++ [ module - (utils.mkPluginPackageModule { inherit loc packPathName package; }) + (utils.mkPluginPackageModule { inherit loc name package; }) (utils.mkMetaModule { inherit loc diff --git a/lib/plugins/mk-vim-plugin.nix b/lib/plugins/mk-vim-plugin.nix index 5637e70e..9f7ea25a 100644 --- a/lib/plugins/mk-vim-plugin.nix +++ b/lib/plugins/mk-vim-plugin.nix @@ -15,7 +15,6 @@ isColorscheme ? false, colorscheme ? name, # options - packPathName ? name, # Can be a string, a list of strings, or a module option: # - A string will be intrpreted as `pkgs.vimPlugins.${package}` # - A list will be interpreted as a "pkgs path", e.g. `pkgs.${elem1}.${elem2}.${etc...}` @@ -59,8 +58,8 @@ let { options = lib.setAttrByPath loc ( { - enable = lib.mkEnableOption packPathName; - autoLoad = lib.nixvim.mkAutoLoadOption cfg packPathName; + enable = lib.mkEnableOption name; + autoLoad = lib.nixvim.mkAutoLoadOption cfg name; } // settingsOption // extraOptions @@ -93,7 +92,7 @@ in imports ++ [ module - (lib.nixvim.plugins.utils.mkPluginPackageModule { inherit loc packPathName package; }) + (lib.nixvim.plugins.utils.mkPluginPackageModule { inherit loc name package; }) (lib.nixvim.plugins.utils.mkMetaModule { inherit loc diff --git a/lib/plugins/utils.nix b/lib/plugins/utils.nix index 84f30f80..87a4b75f 100644 --- a/lib/plugins/utils.nix +++ b/lib/plugins/utils.nix @@ -35,7 +35,7 @@ mkPluginPackageModule = { loc, - packPathName, + name, package, }: # Return a module @@ -49,7 +49,7 @@ if lib.isOption package then package else - lib.mkPackageOption pkgs packPathName { + lib.mkPackageOption pkgs name { default = if builtins.isList package then package