Compare commits

...

3 commits

Author SHA1 Message Date
87e59d7a79
chore(deps): lock file maintenance
Some checks failed
/ check (nvimDev) (push) Successful in 5s
/ check (nvimHeadless) (push) Successful in 3s
/ check (nvimNoBundledBins) (push) Successful in 4s
/ check (nvimNoLsp) (push) Successful in 4s
/ check (nvimNoTSGrammars) (push) Successful in 5s
/ check (treefmt) (push) Successful in 2s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Failing after 2s
/ build (nvim) (push) Successful in 1s
/ report-size (push) Has been skipped
2025-02-17 00:00:33 +01:00
107ffba42c
fix: reduce size by only installing needed progs
Some checks failed
/ check (nvimDev) (push) Successful in 6s
/ check (nvimHeadless) (push) Successful in 3s
/ check (nvimNoBundledBins) (push) Successful in 7s
/ check (nvimNoLsp) (push) Successful in 5s
/ check (nvimNoTSGrammars) (push) Successful in 7s
/ check (treefmt) (push) Successful in 3s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Failing after 3s
/ build (nvim) (push) Successful in 2s
/ report-size (push) Has been skipped
- Only install gopass if password-store is enabled
- Only install gitoxide if dev config is enabled
- Don't install sshfs, haven't used it _ever_ (on NixOS)
2025-02-16 23:58:56 +01:00
5563238f0a
fix: reduce size of config
All checks were successful
/ check (nvimDev) (push) Successful in 5s
/ check (nvimHeadless) (push) Successful in 2s
/ check (nvimNoBundledBins) (push) Successful in 4s
/ check (nvimNoLsp) (push) Successful in 5s
/ check (nvimNoTSGrammars) (push) Successful in 6s
/ check (treefmt) (push) Successful in 3s
/ build (audiomenu) (push) Successful in 1s
/ build (docs) (push) Successful in 1s
/ build (jpassmenu) (push) Successful in 1s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 1s
/ build (nvim) (push) Successful in 1s
/ report-size (push) Successful in 4s
And add more knobs to further reduce the config size.
2025-02-16 23:41:33 +01:00
8 changed files with 122 additions and 114 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 {

12
flake.lock generated
View file

@ -281,11 +281,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739484910, "lastModified": 1739624908,
"narHash": "sha256-wjWLzdM7PIq4ZAe7k3vyjtgVJn6b0UeodtRFlM/6W5U=", "narHash": "sha256-f84lBmLl4tkDp1ZU5LBTSFzlxXP4926DVW3KnXrke10=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0b73e36b1962620a8ac551a37229dd8662dac5c8", "rev": "a60651b217d2e529729cbc7d989c19f3941b9250",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -330,11 +330,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739632145, "lastModified": 1739708385,
"narHash": "sha256-maNBjf9whO303r4+8ekfAZOrf3sHnw6DLiSph5xnXJw=", "narHash": "sha256-H6qPfgE8P6rYMpwj9GsmcZEry52O3U82IqJJy6hx/88=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "b8c55873998948bf14a2b6cf30f9ad5ecdf79818", "rev": "d636d254088a2fa49b585b79097a2766d4e3af80",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -37,6 +37,9 @@ in
}; };
}) })
(lib.mkIf cfg.enable { (lib.mkIf cfg.enable {
# Add gopass if pass is enabled
packages = lib.optional config.programs.password-store.enable pkgs.gopass;
nix.settings.use-xdg-base-directories = fromOs [ nix.settings.use-xdg-base-directories = fromOs [
"nix" "nix"
"settings" "settings"
@ -69,12 +72,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";
}; };
@ -115,11 +116,6 @@ in
home = { home = {
stateVersion = "22.11"; stateVersion = "22.11";
# Extra packages # Extra packages
packages = [
pkgs.gopass
pkgs.sshfs
pkgs.unstable.gitoxide
];
# Extra variables # Extra variables
sessionVariables = { sessionVariables = {
CARGO_HOME = "${config.xdg.dataHome}/cargo"; CARGO_HOME = "${config.xdg.dataHome}/cargo";

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

@ -199,6 +199,7 @@ in
[ "typos" ] # low false positive rate typo checker [ "typos" ] # low false positive rate typo checker
[ "gcc" ] # GNU Compiler Collection [ "gcc" ] # GNU Compiler Collection
[ "git-absorb" ] # fixup! but automatic [ "git-absorb" ] # fixup! but automatic
[ "gitoxide" ] # git but RiiR
[ "man-pages" ] # gimme the man pages [ "man-pages" ] # gimme the man pages
[ "man-pages-posix" ] # I said gimme the man pages!!! [ "man-pages-posix" ] # I said gimme the man pages!!!
]; ];

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,21 +201,21 @@ in
''; '';
options.desc = "Find Quickfix"; options.desc = "Find Quickfix";
} }
# Nvim Silicon
{
mode = "v";
key = "<leader>sc";
action =
mkRaw
# lua
''
require('nvim-silicon').clip
'';
options.desc = "Snap Code (to clipboard)";
}
] ]
++ lib.optional dev { # Nvim Silicon
++ lib.optional (!cfg.reduceSize) {
mode = "v";
key = "<leader>sc";
action =
mkRaw
# lua
''
require('nvim-silicon').clip
'';
options.desc = "Snap Code (to clipboard)";
}
++ lib.optional cfg.dev.enable {
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,91 +18,87 @@
./augroups.nix ./augroups.nix
]; ];
config = { config = lib.mkMerge [
withRuby = false; {
globals.mapleader = " "; withRuby = false;
# Appearance globals.mapleader = " ";
colorschemes.gruvbox = { # Appearance
enable = true; colorschemes.gruvbox = {
settings = { enable = true;
bold = true; settings = {
transparent_mode = true; bold = true;
terminal_colors = true; transparent_mode = true;
terminal_colors = true;
};
}; };
}; opts = {
clipboard.providers.wl-copy.enable = true; number = true;
opts = { relativenumber = true;
number = true; colorcolumn = "+1";
relativenumber = true; cursorline = true;
colorcolumn = "+1"; wrap = false;
cursorline = true; splitright = true;
wrap = false; # Tabs & indentation
splitright = true; smarttab = true;
# Tabs & indentation autoindent = true;
smarttab = true; smartindent = true;
autoindent = true; # Search path
smartindent = true; path = ".,/usr/include,**";
# Search path wildmenu = true;
path = ".,/usr/include,**"; hlsearch = true;
wildmenu = true; incsearch = true;
hlsearch = true; ignorecase = true; # Search ignores cases
incsearch = true; smartcase = true; # Unless it has a capital letter
ignorecase = true; # Search ignores cases # Enable local configuration :h 'exrc'
smartcase = true; # Unless it has a capital letter exrc = true; # safe since nvim 0.9
# Enable local configuration :h 'exrc' };
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 ];
extraPackages = [ extraConfigLuaPre =
pkgs.luajitPackages.jsregexp # lua
pkgs.silicon ''
]; -- Lua Pre Config
extraConfigLuaPre = if vim.fn.has 'termguicolors' then
# lua -- Enable RGB colors
'' vim.g.termguicolors = true
-- Lua Pre Config end
if vim.fn.has 'termguicolors' then
-- Enable RGB colors
vim.g.termguicolors = true
end
-- Useful function -- Useful function
local has_words_before = function() local has_words_before = function()
-- unpack = unpack or table.unpack -- unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 return col ~= 0
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
end end
-- END: Lua Pre Config -- END: Lua Pre Config
''; '';
extraConfigLua = }
# lua # Big packages that are kinda unnecessary
'' (lib.mkIf (!cfg.reduceSize) {
-- Lua Config extraPlugins = [ extraPlugins.nvim-silicon ];
require("nvim-silicon").setup { extraPackages = [ pkgs.silicon ];
theme = "gruvbox-dark", extraConfigLua =
pad_horiz = 16, # lua
pad_vert = 16, ''
-- Current buffer name -- Lua Config
window_title = function() require("nvim-silicon").setup {
return vim.fn.fnamemodify( theme = "gruvbox-dark",
vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), pad_horiz = 16,
":t" pad_vert = 16,
) -- Current buffer name
end, window_title = function()
} return vim.fn.fnamemodify(
-- END: Lua Config vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
''; ":t"
}; )
end,
}
-- END: Lua Config
'';
})
];
} }