fix: reduce size of config #296

Merged
jalil merged 1 commit from push-qzwpzqwovnqv into main 2025-02-16 23:45:02 +01:00
6 changed files with 112 additions and 103 deletions

View file

@ -17,7 +17,10 @@
}; };
}; };
moduleDev = nvimModule { }; moduleDev = nvimModule { };
moduleHeadless = nvimModule { jhome.nvim.dev.enable = false; }; moduleHeadless = nvimModule {
jhome.nvim.dev.enable = false;
jhome.nvim.reduceSize = true;
};
moduleNoLsp = nvimModule { jhome.nvim.dev.bundleLSPs = false; }; moduleNoLsp = nvimModule { jhome.nvim.dev.bundleLSPs = false; };
moduleNoTSGrammars = nvimModule { jhome.nvim.dev.bundleGrammars = false; }; moduleNoTSGrammars = nvimModule { jhome.nvim.dev.bundleGrammars = false; };
moduleNoBundledBins = nvimModule { moduleNoBundledBins = nvimModule {

View file

@ -69,12 +69,10 @@ in
homedir = "${config.xdg.dataHome}/gnupg"; homedir = "${config.xdg.dataHome}/gnupg";
}; };
# Mail client # Mail client
himalaya.enable = true; himalaya.enable = lib.mkDefault true;
# Another shell
nushell.enable = true;
# Password manager # Password manager
password-store = { password-store = {
enable = true; enable = lib.mkDefault true;
package = pkgs.pass-nodmenu; package = pkgs.pass-nodmenu;
settings.PASSWORD_STORE_DIR = "${config.xdg.dataHome}/pass"; settings.PASSWORD_STORE_DIR = "${config.xdg.dataHome}/pass";
}; };

View file

@ -71,6 +71,8 @@ in
enable = true; enable = true;
scripts = builtins.attrValues { inherit (pkgs.mpvScripts) uosc thumbfast; }; scripts = builtins.attrValues { inherit (pkgs.mpvScripts) uosc thumbfast; };
}; };
# Text editor
nixvim.clipboard.providers.wl-copy.enable = lib.mkDefault true;
# Status bar # Status bar
waybar = { waybar = {
enable = true; enable = true;

View file

@ -7,7 +7,6 @@
let let
inherit (helpers) mkRaw; inherit (helpers) mkRaw;
cfg = config.jhome.nvim; cfg = config.jhome.nvim;
dev = cfg.dev.enable;
in in
{ {
config.keymaps = config.keymaps =
@ -202,8 +201,9 @@ in
''; '';
options.desc = "Find Quickfix"; options.desc = "Find Quickfix";
} }
]
# Nvim Silicon # Nvim Silicon
{ ++ lib.optional (!cfg.reduceSize) {
mode = "v"; mode = "v";
key = "<leader>sc"; key = "<leader>sc";
action = action =
@ -215,8 +215,7 @@ in
''; '';
options.desc = "Snap Code (to clipboard)"; options.desc = "Snap Code (to clipboard)";
} }
] ++ lib.optional cfg.dev.enable {
++ lib.optional dev {
mode = "n"; mode = "n";
key = "<leader>w"; key = "<leader>w";
action = action =

View file

@ -12,6 +12,7 @@ in
{ {
options.jhome.nvim = { options.jhome.nvim = {
enable = mkDisableOption "jalil's Neovim configuration"; enable = mkDisableOption "jalil's Neovim configuration";
reduceSize = mkEnableOption "reduce size by disabling big modules";
dev = mkOption { dev = mkOption {
type = types.submodule { type = types.submodule {
options = { options = {

View file

@ -1,4 +1,14 @@
{ pkgs, ... }: {
lib,
pkgs,
config,
...
}:
let
cfg = config.jhome.nvim;
plugins = pkgs.vimPlugins;
extraPlugins = import ./extraPlugins { inherit pkgs; };
in
{ {
imports = [ imports = [
./options.nix ./options.nix
@ -8,7 +18,8 @@
./augroups.nix ./augroups.nix
]; ];
config = { config = lib.mkMerge [
{
withRuby = false; withRuby = false;
globals.mapleader = " "; globals.mapleader = " ";
# Appearance # Appearance
@ -20,7 +31,6 @@
terminal_colors = true; terminal_colors = true;
}; };
}; };
clipboard.providers.wl-copy.enable = true;
opts = { opts = {
number = true; number = true;
relativenumber = true; relativenumber = true;
@ -42,22 +52,12 @@
# Enable local configuration :h 'exrc' # Enable local configuration :h 'exrc'
exrc = true; # safe since nvim 0.9 exrc = true; # safe since nvim 0.9
}; };
extraPlugins = extraPlugins = [
let
plugins = pkgs.vimPlugins;
extraPlugins = import ./extraPlugins { inherit pkgs; };
in
[
plugins.nui-nvim plugins.nui-nvim
plugins.nvim-web-devicons plugins.nvim-web-devicons
plugins.vim-jjdescription plugins.vim-jjdescription # FIXME: included since neovim nightly
extraPlugins.nvim-silicon
];
# Formatting & linters
extraPackages = [
pkgs.luajitPackages.jsregexp
pkgs.silicon
]; ];
extraPackages = [ pkgs.luajitPackages.jsregexp ];
extraConfigLuaPre = extraConfigLuaPre =
# lua # lua
'' ''
@ -76,6 +76,11 @@
end end
-- END: Lua Pre Config -- END: Lua Pre Config
''; '';
}
# Big packages that are kinda unnecessary
(lib.mkIf (!cfg.reduceSize) {
extraPlugins = [ extraPlugins.nvim-silicon ];
extraPackages = [ pkgs.silicon ];
extraConfigLua = extraConfigLua =
# lua # lua
'' ''
@ -94,5 +99,6 @@
} }
-- END: Lua Config -- END: Lua Config
''; '';
}; })
];
} }