fix: reduce size of config #296
6 changed files with 112 additions and 103 deletions
|
@ -17,7 +17,10 @@
|
|||
};
|
||||
};
|
||||
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; };
|
||||
moduleNoTSGrammars = nvimModule { jhome.nvim.dev.bundleGrammars = false; };
|
||||
moduleNoBundledBins = nvimModule {
|
||||
|
|
|
@ -69,12 +69,10 @@ in
|
|||
homedir = "${config.xdg.dataHome}/gnupg";
|
||||
};
|
||||
# Mail client
|
||||
himalaya.enable = true;
|
||||
# Another shell
|
||||
nushell.enable = true;
|
||||
himalaya.enable = lib.mkDefault true;
|
||||
# Password manager
|
||||
password-store = {
|
||||
enable = true;
|
||||
enable = lib.mkDefault true;
|
||||
package = pkgs.pass-nodmenu;
|
||||
settings.PASSWORD_STORE_DIR = "${config.xdg.dataHome}/pass";
|
||||
};
|
||||
|
|
|
@ -71,6 +71,8 @@ in
|
|||
enable = true;
|
||||
scripts = builtins.attrValues { inherit (pkgs.mpvScripts) uosc thumbfast; };
|
||||
};
|
||||
# Text editor
|
||||
nixvim.clipboard.providers.wl-copy.enable = lib.mkDefault true;
|
||||
# Status bar
|
||||
waybar = {
|
||||
enable = true;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
let
|
||||
inherit (helpers) mkRaw;
|
||||
cfg = config.jhome.nvim;
|
||||
dev = cfg.dev.enable;
|
||||
in
|
||||
{
|
||||
config.keymaps =
|
||||
|
@ -202,8 +201,9 @@ in
|
|||
'';
|
||||
options.desc = "Find Quickfix";
|
||||
}
|
||||
]
|
||||
# Nvim Silicon
|
||||
{
|
||||
++ lib.optional (!cfg.reduceSize) {
|
||||
mode = "v";
|
||||
key = "<leader>sc";
|
||||
action =
|
||||
|
@ -215,8 +215,7 @@ in
|
|||
'';
|
||||
options.desc = "Snap Code (to clipboard)";
|
||||
}
|
||||
]
|
||||
++ lib.optional dev {
|
||||
++ lib.optional cfg.dev.enable {
|
||||
mode = "n";
|
||||
key = "<leader>w";
|
||||
action =
|
||||
|
|
|
@ -12,6 +12,7 @@ in
|
|||
{
|
||||
options.jhome.nvim = {
|
||||
enable = mkDisableOption "jalil's Neovim configuration";
|
||||
reduceSize = mkEnableOption "reduce size by disabling big modules";
|
||||
dev = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.jhome.nvim;
|
||||
plugins = pkgs.vimPlugins;
|
||||
extraPlugins = import ./extraPlugins { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./options.nix
|
||||
|
@ -8,7 +18,8 @@
|
|||
./augroups.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
withRuby = false;
|
||||
globals.mapleader = " ";
|
||||
# Appearance
|
||||
|
@ -20,7 +31,6 @@
|
|||
terminal_colors = true;
|
||||
};
|
||||
};
|
||||
clipboard.providers.wl-copy.enable = true;
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
@ -42,22 +52,12 @@
|
|||
# Enable local configuration :h 'exrc'
|
||||
exrc = true; # safe since nvim 0.9
|
||||
};
|
||||
extraPlugins =
|
||||
let
|
||||
plugins = pkgs.vimPlugins;
|
||||
extraPlugins = import ./extraPlugins { inherit pkgs; };
|
||||
in
|
||||
[
|
||||
extraPlugins = [
|
||||
plugins.nui-nvim
|
||||
plugins.nvim-web-devicons
|
||||
plugins.vim-jjdescription
|
||||
extraPlugins.nvim-silicon
|
||||
];
|
||||
# Formatting & linters
|
||||
extraPackages = [
|
||||
pkgs.luajitPackages.jsregexp
|
||||
pkgs.silicon
|
||||
plugins.vim-jjdescription # FIXME: included since neovim nightly
|
||||
];
|
||||
extraPackages = [ pkgs.luajitPackages.jsregexp ];
|
||||
extraConfigLuaPre =
|
||||
# lua
|
||||
''
|
||||
|
@ -76,6 +76,11 @@
|
|||
end
|
||||
-- END: Lua Pre Config
|
||||
'';
|
||||
}
|
||||
# Big packages that are kinda unnecessary
|
||||
(lib.mkIf (!cfg.reduceSize) {
|
||||
extraPlugins = [ extraPlugins.nvim-silicon ];
|
||||
extraPackages = [ pkgs.silicon ];
|
||||
extraConfigLua =
|
||||
# lua
|
||||
''
|
||||
|
@ -94,5 +99,6 @@
|
|||
}
|
||||
-- END: Lua Config
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue