nvf finally working well!

This commit is contained in:
Charlie Root 2024-07-07 23:45:18 +02:00
commit fea17cb5c1
24 changed files with 209 additions and 189 deletions

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
config,
...
}: {
# allow unfree packages # allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Time Zone # Time Zone
@ -12,6 +16,7 @@
trusted-public-keys = [ trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
]; ];
trusted-users = ["root" "${config.modules.other.system.username}"];
# enable flakes # enable flakes
experimental-features = ["nix-command" "flakes"]; experimental-features = ["nix-command" "flakes"];
# reduce file size used & automatic garbage collector # reduce file size used & automatic garbage collector
@ -81,7 +86,7 @@
}; };
helix.enable = true; helix.enable = true;
kakoune.enable = true; kakoune.enable = true;
nixvim.enable = false; # broken at the moment # nixvim.enable = false; # broken at the moment
neovim.enable = true; neovim.enable = true;
}; };
services = { services = {

View file

@ -14,6 +14,7 @@ in {
bluetuith bluetuith
bluez bluez
bun bun
cachix
cmake cmake
difftastic difftastic
dig dig
@ -45,7 +46,6 @@ in {
gnome.nautilus gnome.nautilus
ncmpcpp ncmpcpp
neofetch neofetch
neovim
networkmanagerapplet networkmanagerapplet
nextcloud-client nextcloud-client
nicotine-plus nicotine-plus

View file

@ -1 +1 @@
_: {imports = [./emacs.nix ./helix.nix ./kakoune.nix ./nixvim/nixvim.nix ./nvf];} _: {imports = [./emacs.nix ./helix.nix ./kakoune.nix ./nvf];}

View file

@ -1,4 +1,5 @@
{ {
pkgs,
config, config,
lib, lib,
inputs, inputs,
@ -11,20 +12,44 @@
mkNeovimModule = { mkNeovimModule = {
path, path,
ingoredPaths ? [./nvf.nix ./plugins/sources/default.nix], ignoredPaths ? [./nvf.nix ./plugins/sources/default.nix ./plugins],
}: }:
filter (hasSuffix ".nix") ( filter (hasSuffix ".nix") (
map toString ( map toString (
filter (path: path != ./default.nix && !elem path ingoredPaths) (listFilesRecursive path) filter (path: path != ./default.nix && !elem path ignoredPaths) (listFilesRecursive path)
) )
); );
nvf = inputs.neovim-flake; nvf = inputs.neovim-flake;
in { in {
imports = concatLists [ environment.systemPackages = with pkgs; [
typstyle
];
imports = concatLists [
# neovim-flake home-manager module # neovim-flake home-manager module
[nvf.nixosModules.default] [nvf.nixosModules.default]
# [./plugins/settings/ui.nix]
# [./plugins/settings/filetree.nix]
# [
# ./plugins/settings/autocomplete.nix
# ./plugins/settings/visuals.nix
# ./plugins/settings/autopairs.nix
# ./plugins/settings/binds.nix
# ./plugins/settings/comments.nix
# ./plugins/settings/dashboard.nix
# ./plugins/settings/debugger.nix
# ./plugins/settings/languages.nix
# ./plugins/settings/lsp.nix
# ./plugins/settings/telescope.nix
# ./plugins/settings/notes.nix
# ./plugins/settings/notify.nix
# ./plugins/settings/projects.nix
# ./plugins/settings/statusline.nix
# ./plugins/settings/tabline.nix
# ./plugins/settings/theme.nix
# ./plugins/settings/treesitter.nix
# ./plugins/settings/utility.nix
# ./plugins/settings/git.nix
# construct this entore directory as a module # construct this entore directory as a module
# which means all default.nix files will be imported automtically # which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;}) (mkNeovimModule {path = ./.;})

View file

@ -1,13 +1,14 @@
{ {
programs.neovim-flake.settings.vim.maps = { programs.neovim-flake.settings.vim.maps = {
normal = { normal = {
/*
# General # General
"<leader>fd".action = ":lua vim.g.formatsave = not vim.g.formatsave<CR>"; "<leader>fd".action = ":lua vim.g.formatsave = not vim.g.formatsave<CR>";
"<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>"; "<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>";
"<leader>e".action = ":NvimTreeToggle<CR>"; #"<leader>e".action = ":NvimTreeToggle<CR>";
"<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>"; # "<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
"<leader>lf".action = ":lua vim.lsp.buf.format()<CR>"; # "<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
"<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>"; # "<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
"<leader>;".action = "A;<esc>"; # Append # "<leader>;".action = "A;<esc>"; # Append #
# Diffview # Diffview
@ -44,9 +45,11 @@
# vsnip # vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)"; #"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)"; #"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
*/
}; };
normalVisualOp = { normalVisualOp = {
/*
"<leader>gs".action = ":Gitsigns stage_hunk<CR>"; "<leader>gs".action = ":Gitsigns stage_hunk<CR>";
"<leader>gr".action = ":Gitsigns reset_hunk<CR>"; "<leader>gr".action = ":Gitsigns reset_hunk<CR>";
"<leader>lr".action = "<cmd>lua vim.lsp.buf.references()<CR>"; "<leader>lr".action = "<cmd>lua vim.lsp.buf.references()<CR>";
@ -60,6 +63,7 @@
action = "':ToggleTermSendVisualLines ' . v:count == 0 ? g:default_terminal : v:count"; action = "':ToggleTermSendVisualLines ' . v:count == 0 ? g:default_terminal : v:count";
expr = true; expr = true;
}; };
*/
}; };
}; };
} }

View file

@ -4,12 +4,11 @@
... ...
}: let }: let
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
inherit (pkgs.vimPlugins) friendly-snippets aerial-nvim nvim-surround undotree mkdir-nvim ssr-nvim direnv-vim legendary-nvim; inherit (pkgs.vimPlugins) friendly-snippets aerial-nvim nvim-surround undotree mkdir-nvim ssr-nvim direnv-vim legendary-nvim lazygit-nvim;
inherit (pkgs) fetchFromGitHub; inherit (pkgs) fetchFromGitHub;
inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs.vimUtils) buildVimPlugin;
pluginSources = { pluginSources = {
smart-splits = buildVimPlugin { smart-splits = buildVimPlugin {
name = "smart-splits"; name = "smart-splits";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -59,7 +58,7 @@
hash = "sha256-D5hvLhsYski11H9qiDDL2zlZMtYmbpHgpewiWR6C7rE="; hash = "sha256-D5hvLhsYski11H9qiDDL2zlZMtYmbpHgpewiWR6C7rE=";
}; };
}; };
*/ */
vim-nftables = buildVimPlugin { vim-nftables = buildVimPlugin {
name = "vim-nftables"; name = "vim-nftables";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -80,13 +79,14 @@
}; };
}; };
}; };
in { in {
programs.neovim-flake.settings.vim.extraPlugins = { programs.neovim-flake.settings.vim.extraPlugins = {
# plugins that are pulled from nixpkgs # plugins that are pulled from nixpkgs
/*
direnv = {package = direnv-vim;}; direnv = {package = direnv-vim;};
friendly-snippets = {package = friendly-snippets;}; friendly-snippets = {package = friendly-snippets;};
mkdir-nvim = {package = mkdir-nvim;}; mkdir-nvim = {package = mkdir-nvim;};
lazygit-nvim = {package = lazygit-nvim;};
aerial = { aerial = {
package = aerial-nvim; package = aerial-nvim;
setup = "require('aerial').setup {}"; setup = "require('aerial').setup {}";
@ -120,7 +120,7 @@ in {
# plugins that are built from their sources # plugins that are built from their sources
regexplainer = {package = pluginSources.regexplainer;}; regexplainer = {package = pluginSources.regexplainer;};
vim-nftables = {package = pluginSources.vim-nftables;}; vim-nftables = {package = pluginSources.vim-nftables;};
/* /*
data-view = { data-view = {
package = pluginSources.data-viewer-nvim; package = pluginSources.data-viewer-nvim;
setup = '' setup = ''
@ -137,8 +137,6 @@ in {
vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true}) vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true})
''; '';
}; };
*/
smart-splits = { smart-splits = {
package = pluginSources.smart-splits; package = pluginSources.smart-splits;
setup = "require('smart-splits').setup {}"; setup = "require('smart-splits').setup {}";
@ -204,5 +202,6 @@ in {
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
''; '';
}; };
*/
}; };
} }

View file

@ -1,8 +1,8 @@
_:{ _:{
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
assistant.copilot = { assistant.copilot = {
enable = true; enable = false;
cmp.enable = true; cmp.enable = false;
}; };
}; };
} }

View file

@ -5,7 +5,7 @@ _:{
type = "nvim-cmp"; type = "nvim-cmp";
mappings = { mappings = {
# close = "<C-e>"; # close = "<C-e>";
confirm = "<C-y>"; # confirm = "<tab>";
next = "<C-n>"; next = "<C-n>";
previous = "<C-p>"; previous = "<C-p>";
scrollDocsDown = "<C-j>"; scrollDocsDown = "<C-j>";

View file

@ -1,6 +1,4 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
autopairs.enable = true; autopairs.enable = true;
}; };

View file

@ -3,7 +3,7 @@
in { in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
dashboard = { dashboard = {
alpha.enable = true; alpha.enable = false;
}; };
}; };
} }

View file

@ -1,6 +1,4 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
filetree = { filetree = {
nvimTree = { nvimTree = {
@ -9,6 +7,7 @@ in {
mappings = { mappings = {
#toggle = "<C-w>"; #toggle = "<C-w>";
toggle = "<leader>e";
}; };
setupOpts = { setupOpts = {

View file

@ -1,4 +1,4 @@
_:{ _: {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
git = { git = {
enable = true; enable = true;

View file

@ -1,4 +1,4 @@
_:{ _: {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
languages = { languages = {
enableLSP = true; enableLSP = true;

View file

@ -1,4 +1,4 @@
_:{ _: {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
lsp = { lsp = {
formatOnSave = true; formatOnSave = true;
@ -8,8 +8,8 @@ _:{
lspsaga.enable = false; lspsaga.enable = false;
lspSignature.enable = true; lspSignature.enable = true;
nvimCodeActionMenu.enable = true; nvimCodeActionMenu.enable = true;
trouble.enable = false; # trouble.enable = false;
nvim-docs-view.enable = true; # nvim-docs-view.enable = true;
}; };
}; };
} }

View file

@ -1,6 +1,4 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
statusline = { statusline = {
lualine = { lualine = {

View file

@ -1,6 +1,4 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
tabline = { tabline = {
nvimBufferline.enable = true; nvimBufferline.enable = true;

View file

@ -1,8 +1,8 @@
_:{ _: {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
terminal = { terminal = {
toggleterm = { toggleterm = {
enable = true; enable = false;
mappings.open = "<C-t>"; mappings.open = "<C-t>";
setupOpts = { setupOpts = {
@ -10,7 +10,6 @@ _:{
lazygit = { lazygit = {
enable = true; enable = true;
direction = "tab"; direction = "tab";
mappings.open = "<leader>gg";
}; };
}; };
}; };

View file

@ -9,7 +9,7 @@ in {
ui = { ui = {
noice.enable = true; noice.enable = true;
colorizer.enable = true; colorizer.enable = true;
modes-nvim.enable = false; modes-nvim.enable = true;
illuminate.enable = true; illuminate.enable = true;
breadcrumbs = { breadcrumbs = {

View file

@ -1,30 +1,24 @@
{ {pkgs, ...}: {
config,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
utility = { utility = {
ccc.enable = true; ccc.enable = true;
icon-picker.enable = true; icon-picker.enable = true;
diffview-nvim.enable = true; diffview-nvim.enable = true;
#
vim-wakatime = { vim-wakatime = {
enable = true; enable = true;
cli-package = pkgs.wakatime-cli; cli-package = pkgs.wakatime-cli;
}; };
#
motion = { # motion = {
hop.enable = true; # hop.enable = false;
leap.enable = false; # leap.enable = false;
}; # };
#
preview = { # preview = {
glow.enable = true; # glow.enable = true;
markdownPreview.enable = true; # markdownPreview.enable = true;
}; # };
}; };
}; };
} }

View file

@ -5,7 +5,7 @@ in {
visuals = { visuals = {
enable = true; enable = true;
nvimWebDevicons.enable = true; nvimWebDevicons.enable = true;
scrollBar.enable = true; scrollBar.enable = false;
smoothScroll.enable = false; smoothScroll.enable = false;
cellularAutomaton.enable = false; cellularAutomaton.enable = false;
highlight-undo.enable = true; highlight-undo.enable = true;

View file

@ -38,7 +38,7 @@ in {
# alternatively, neovim-nightly from the neovim-nightly overlay # alternatively, neovim-nightly from the neovim-nightly overlay
# via inputs.neovim-nightly.packages.${pkgs.stdenv.system}.neovim # via inputs.neovim-nightly.packages.${pkgs.stdenv.system}.neovim
package = pkgs.neovim-unwrapped; package = pkgs.neovim-unwrapped;
/*
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
@ -51,7 +51,7 @@ in {
spellcheck = { spellcheck = {
enable = true; enable = true;
# TODO add de # TODO add de
languages = ["en"]; languages = ["en" "de"];
}; };
enableLuaLoader = true; enableLuaLoader = true;
@ -71,9 +71,9 @@ in {
# I have come to realise that spellfile contents are # I have come to realise that spellfile contents are
# actually **not** loaded when luaConfigRC is used. # actually **not** loaded when luaConfigRC is used.
# as spellfile is a vim thing, this should be fine # as spellfile is a vim thing, this should be fine
configRC.spellfile = entryAnywhere '' # configRC.spellfile = entryAnywhere ''
set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path # set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path
''; # '';
# additional lua configuration that I can append # additional lua configuration that I can append
# or, to be more precise, randomly inject into # or, to be more precise, randomly inject into
@ -94,6 +94,7 @@ in {
''); '');
in in
luaConfig; luaConfig;
*/
}; };
}; };
}; };

View file

@ -1,3 +1,3 @@
_: { _: {
imports = [./btop.nix ./neovim.nix ./newsboat.nix ./ncmpcpp.nix ./yazi.nix]; imports = [./btop.nix ./newsboat.nix ./ncmpcpp.nix ./yazi.nix];
} }