nvim++ #134

Merged
jalil merged 2 commits from nvim++ into main 2024-11-06 23:09:05 +01:00
3 changed files with 33 additions and 52 deletions

View file

@ -7,15 +7,8 @@
let let
nixvimLib = inputs.nixvim.lib.${system}; nixvimLib = inputs.nixvim.lib.${system};
nixvim = inputs.nixvim.legacyPackages.${system}; nixvim = inputs.nixvim.legacyPackages.${system};
moduleDev = { testNvimModule = nixvimLib.check.mkTestDerivationFromNixvimModule;
inherit pkgs; nvimModule = extraConfig: {
extraSpecialArgs = {
inherit (inputs) unstable;
inherit system;
};
module = import ../nvim/standalone.nix { standalone = true; };
};
moduleHeadless = {
inherit pkgs; inherit pkgs;
extraSpecialArgs = { extraSpecialArgs = {
inherit (inputs) unstable; inherit (inputs) unstable;
@ -23,57 +16,37 @@
}; };
module = { module = {
imports = [ (import ../nvim/standalone.nix { standalone = true; }) ]; imports = [ (import ../nvim/standalone.nix { standalone = true; }) ];
config.jhome.nvim.dev.enable = false; config = extraConfig;
}; };
}; };
moduleNoLsp = { moduleDev = nvimModule { };
inherit pkgs; moduleHeadless = nvimModule { jhome.nvim.dev.enable = false; };
extraSpecialArgs = { moduleNoLsp = nvimModule { jhome.nvim.dev.bundleLSPs = false; };
inherit (inputs) unstable; moduleNoTSGrammars = nvimModule { jhome.nvim.dev.bundleGrammars = false; };
inherit system; moduleNoBundledBins = nvimModule {
}; jhome.nvim.dev = {
module = {
imports = [ (import ../nvim/standalone.nix { standalone = true; }) ];
config.jhome.nvim.dev.bundleLSPs = false;
};
};
moduleNoTSGrammars = {
inherit pkgs;
extraSpecialArgs = {
inherit (inputs) unstable;
inherit system;
};
module = {
imports = [ (import ../nvim/standalone.nix { standalone = true; }) ];
config.jhome.nvim.dev.bundleGrammars = false;
};
};
moduleNoBundledBins = {
inherit pkgs;
extraSpecialArgs = {
inherit (inputs) unstable;
inherit system;
};
module = {
imports = [ (import ../nvim/standalone.nix { standalone = true; }) ];
config.jhome.nvim.dev = {
bundleLSPs = false; bundleLSPs = false;
bundleGrammars = false; bundleGrammars = false;
}; };
}; };
};
in in
{ {
# Check standalone nvim build # Check standalone nvim build
checks = { checks = {
nvimDev = nixvimLib.check.mkTestDerivationFromNixvimModule moduleDev; nvimDev = testNvimModule moduleDev;
nvimHeadless = nixvimLib.check.mkTestDerivationFromNixvimModule moduleHeadless; nvimHeadless = testNvimModule moduleHeadless;
nvimNoLsp = nixvimLib.check.mkTestDerivationFromNixvimModule moduleNoLsp; nvimNoLsp = testNvimModule moduleNoLsp;
nvimNoTSGrammars = nixvimLib.check.mkTestDerivationFromNixvimModule moduleNoTSGrammars; nvimNoTSGrammars = testNvimModule moduleNoTSGrammars;
nvimNoBundledBins = nixvimLib.check.mkTestDerivationFromNixvimModule moduleNoBundledBins; nvimNoBundledBins = testNvimModule moduleNoBundledBins;
}; };
# Nvim standalone module # Nvim standalone module
packages.nvim = nixvim.makeNixvimWithModule moduleDev; packages = {
nvim = nixvim.makeNixvimWithModule moduleDev;
# Smaller derivations
nvim-small = nixvim.makeNixvimWithModule moduleNoBundledBins;
nvim-no-ts = nixvim.makeNixvimWithModule moduleNoTSGrammars;
nvim-no-lsps = nixvim.makeNixvimWithModule moduleNoLsp;
};
}; };
} }

View file

@ -63,6 +63,14 @@ in
} }
# Do not bundle treesitter grammars # Do not bundle treesitter grammars
(lib.mkIf (!cfg.dev.bundleGrammars) { plugins.treesitter.grammarPackages = [ ]; }) (lib.mkIf (!cfg.dev.bundleGrammars) { plugins.treesitter.grammarPackages = [ ]; })
# Remove tools for building gramars when bundling them
(lib.mkIf cfg.dev.bundleGrammars {
plugins.treesitter = {
gccPackage = null;
nodejsPackage = null;
treesitterPackage = null;
};
})
# Configure Formatters # Configure Formatters
{ {
extraPackages = [ extraPackages = [

View file

@ -16,8 +16,8 @@ in
type = types.submodule { type = types.submodule {
options = { options = {
enable = mkDisableOption "development configuration"; enable = mkDisableOption "development configuration";
bundleLSPs = mkDisableOption "bundling LSPs with Neovim"; bundleLSPs = mkDisableOption "bundling LSPs with Neovim (decreases size when disabled)";
bundleGrammars = mkDisableOption "bundling treesitter grammars with Neovim"; bundleGrammars = mkDisableOption "bundling treesitter grammars with Neovim (barely decreases size when disabled)";
}; };
}; };
default = { }; default = { };