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

View file

@ -14,6 +14,7 @@ in {
bluetuith
bluez
bun
cachix
cmake
difftastic
dig
@ -45,7 +46,6 @@ in {
gnome.nautilus
ncmpcpp
neofetch
neovim
networkmanagerapplet
nextcloud-client
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,
lib,
inputs,
@ -11,20 +12,44 @@
mkNeovimModule = {
path,
ingoredPaths ? [./nvf.nix ./plugins/sources/default.nix],
ignoredPaths ? [./nvf.nix ./plugins/sources/default.nix ./plugins],
}:
filter (hasSuffix ".nix") (
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;
in {
imports = concatLists [
environment.systemPackages = with pkgs; [
typstyle
];
imports = concatLists [
# neovim-flake home-manager module
[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
# which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;})

View file

@ -1,13 +1,14 @@
{
programs.neovim-flake.settings.vim.maps = {
normal = {
/*
# General
"<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>e".action = ":NvimTreeToggle<CR>";
"<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
"<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
"<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
#"<leader>e".action = ":NvimTreeToggle<CR>";
# "<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
# "<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
# "<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
"<leader>;".action = "A;<esc>"; # Append #
# Diffview
@ -44,9 +45,11 @@
# vsnip
#"<C-jn>".action = "<Plug>(vsnip-jump-next)";
#"<C-jp>".action = "<Plug>(vsnip-jump-prev)";
*/
};
normalVisualOp = {
/*
"<leader>gs".action = ":Gitsigns stage_hunk<CR>";
"<leader>gr".action = ":Gitsigns reset_hunk<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";
expr = true;
};
*/
};
};
}

View file

@ -4,12 +4,11 @@
...
}: let
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.vimUtils) buildVimPlugin;
pluginSources = {
smart-splits = buildVimPlugin {
name = "smart-splits";
src = fetchFromGitHub {
@ -59,7 +58,7 @@
hash = "sha256-D5hvLhsYski11H9qiDDL2zlZMtYmbpHgpewiWR6C7rE=";
};
};
*/
*/
vim-nftables = buildVimPlugin {
name = "vim-nftables";
src = fetchFromGitHub {
@ -80,13 +79,14 @@
};
};
};
in {
programs.neovim-flake.settings.vim.extraPlugins = {
# plugins that are pulled from nixpkgs
/*
direnv = {package = direnv-vim;};
friendly-snippets = {package = friendly-snippets;};
mkdir-nvim = {package = mkdir-nvim;};
lazygit-nvim = {package = lazygit-nvim;};
aerial = {
package = aerial-nvim;
setup = "require('aerial').setup {}";
@ -120,7 +120,7 @@ in {
# plugins that are built from their sources
regexplainer = {package = pluginSources.regexplainer;};
vim-nftables = {package = pluginSources.vim-nftables;};
/*
/*
data-view = {
package = pluginSources.data-viewer-nvim;
setup = ''
@ -137,8 +137,6 @@ in {
vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true})
'';
};
*/
smart-splits = {
package = pluginSources.smart-splits;
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 })
'';
};
*/
};
}

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
in {
programs.neovim-flake.settings.vim = {
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 = {
filetree = {
nvimTree = {
@ -9,6 +7,7 @@ in {
mappings = {
#toggle = "<C-w>";
toggle = "<leader>e";
};
setupOpts = {

View file

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

View file

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

View file

@ -1,4 +1,4 @@
_:{
_: {
programs.neovim-flake.settings.vim = {
lsp = {
formatOnSave = true;
@ -8,8 +8,8 @@ _:{
lspsaga.enable = false;
lspSignature.enable = true;
nvimCodeActionMenu.enable = true;
trouble.enable = false;
nvim-docs-view.enable = true;
# trouble.enable = false;
# 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 = {
statusline = {
lualine = {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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