From 054964fd6629d1e0c712466685bf6499bcc24f82 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 21 Dec 2024 21:49:59 -0500 Subject: [PATCH] refactor(nvim): clean up directory structure --- homeManagerModules/neovim/default.nix | 6 ++--- .../neovim/{git.nix => git/default.nix} | 0 .../langs/{bash.nix => bash/default.nix} | 0 .../langs/{clang.nix => c-lang/default.nix} | 0 .../neovim/{plugins => langs/config}/cmp.lua | 0 .../langs/{csharp.nix => csharp/default.nix} | 0 homeManagerModules/neovim/langs/default.nix | 26 +++++++++---------- .../{hyprlang.nix => hyprlang/default.nix} | 0 .../langs/{java.nix => java/default.nix} | 0 .../langs/{json.nix => json/default.nix} | 0 .../neovim/langs/{lua.nix => lua/default.nix} | 0 .../{markdown.nix => markdown/default.nix} | 0 .../langs/{nix.nix => nix-lang/default.nix} | 0 .../langs/{python.nix => python/default.nix} | 0 .../langs/{rust.nix => rust/default.nix} | 0 .../neovim/langs/{web.nix => web/default.nix} | 0 .../{plugins => theme/config}/heirline.lua | 0 .../{plugins => theme/config}/neotree.lua | 0 .../neovim/{theme.nix => theme/default.nix} | 6 +++-- .../neovim/{ => theme}/treesitter.nix | 0 20 files changed, 20 insertions(+), 18 deletions(-) rename homeManagerModules/neovim/{git.nix => git/default.nix} (100%) rename homeManagerModules/neovim/langs/{bash.nix => bash/default.nix} (100%) rename homeManagerModules/neovim/langs/{clang.nix => c-lang/default.nix} (100%) rename homeManagerModules/neovim/{plugins => langs/config}/cmp.lua (100%) rename homeManagerModules/neovim/langs/{csharp.nix => csharp/default.nix} (100%) rename homeManagerModules/neovim/langs/{hyprlang.nix => hyprlang/default.nix} (100%) rename homeManagerModules/neovim/langs/{java.nix => java/default.nix} (100%) rename homeManagerModules/neovim/langs/{json.nix => json/default.nix} (100%) rename homeManagerModules/neovim/langs/{lua.nix => lua/default.nix} (100%) rename homeManagerModules/neovim/langs/{markdown.nix => markdown/default.nix} (100%) rename homeManagerModules/neovim/langs/{nix.nix => nix-lang/default.nix} (100%) rename homeManagerModules/neovim/langs/{python.nix => python/default.nix} (100%) rename homeManagerModules/neovim/langs/{rust.nix => rust/default.nix} (100%) rename homeManagerModules/neovim/langs/{web.nix => web/default.nix} (100%) rename homeManagerModules/neovim/{plugins => theme/config}/heirline.lua (100%) rename homeManagerModules/neovim/{plugins => theme/config}/neotree.lua (100%) rename homeManagerModules/neovim/{theme.nix => theme/default.nix} (97%) rename homeManagerModules/neovim/{ => theme}/treesitter.nix (100%) diff --git a/homeManagerModules/neovim/default.nix b/homeManagerModules/neovim/default.nix index f1be72ea..e1008220 100644 --- a/homeManagerModules/neovim/default.nix +++ b/homeManagerModules/neovim/default.nix @@ -7,10 +7,10 @@ self: { inherit (lib) mkOption types; in { imports = [ - ./git.nix - ./treesitter.nix + ./git + (import ./langs self) - (import ./theme.nix self) + (import ./theme self) ]; options.programs.neovim = { diff --git a/homeManagerModules/neovim/git.nix b/homeManagerModules/neovim/git/default.nix similarity index 100% rename from homeManagerModules/neovim/git.nix rename to homeManagerModules/neovim/git/default.nix diff --git a/homeManagerModules/neovim/langs/bash.nix b/homeManagerModules/neovim/langs/bash/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/bash.nix rename to homeManagerModules/neovim/langs/bash/default.nix diff --git a/homeManagerModules/neovim/langs/clang.nix b/homeManagerModules/neovim/langs/c-lang/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/clang.nix rename to homeManagerModules/neovim/langs/c-lang/default.nix diff --git a/homeManagerModules/neovim/plugins/cmp.lua b/homeManagerModules/neovim/langs/config/cmp.lua similarity index 100% rename from homeManagerModules/neovim/plugins/cmp.lua rename to homeManagerModules/neovim/langs/config/cmp.lua diff --git a/homeManagerModules/neovim/langs/csharp.nix b/homeManagerModules/neovim/langs/csharp/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/csharp.nix rename to homeManagerModules/neovim/langs/csharp/default.nix diff --git a/homeManagerModules/neovim/langs/default.nix b/homeManagerModules/neovim/langs/default.nix index 0a470ebd..fe042aee 100644 --- a/homeManagerModules/neovim/langs/default.nix +++ b/homeManagerModules/neovim/langs/default.nix @@ -9,19 +9,19 @@ self: { cfg = config.programs.neovim; in { imports = [ - ./bash.nix - ./clang.nix - ./hyprlang.nix - ./java.nix - ./json.nix - ./lua.nix - ./python.nix - ./rust.nix + ./bash + ./c-lang + ./hyprlang + ./java + ./json + ./lua + ./python + ./rust - (import ./csharp.nix self) - (import ./markdown.nix self) - (import ./nix.nix self) - (import ./web.nix self) + (import ./csharp self) + (import ./markdown self) + (import ./nix-lang self) + (import ./web self) ]; # FIXME: try making LSPs and stuff only available through devShells @@ -79,7 +79,7 @@ in { { plugin = pkgs.vimPlugins.nvim-cmp; type = "lua"; - config = fileContents ../plugins/cmp.lua; + config = fileContents ./config/cmp.lua; } { diff --git a/homeManagerModules/neovim/langs/hyprlang.nix b/homeManagerModules/neovim/langs/hyprlang/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/hyprlang.nix rename to homeManagerModules/neovim/langs/hyprlang/default.nix diff --git a/homeManagerModules/neovim/langs/java.nix b/homeManagerModules/neovim/langs/java/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/java.nix rename to homeManagerModules/neovim/langs/java/default.nix diff --git a/homeManagerModules/neovim/langs/json.nix b/homeManagerModules/neovim/langs/json/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/json.nix rename to homeManagerModules/neovim/langs/json/default.nix diff --git a/homeManagerModules/neovim/langs/lua.nix b/homeManagerModules/neovim/langs/lua/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/lua.nix rename to homeManagerModules/neovim/langs/lua/default.nix diff --git a/homeManagerModules/neovim/langs/markdown.nix b/homeManagerModules/neovim/langs/markdown/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/markdown.nix rename to homeManagerModules/neovim/langs/markdown/default.nix diff --git a/homeManagerModules/neovim/langs/nix.nix b/homeManagerModules/neovim/langs/nix-lang/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/nix.nix rename to homeManagerModules/neovim/langs/nix-lang/default.nix diff --git a/homeManagerModules/neovim/langs/python.nix b/homeManagerModules/neovim/langs/python/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/python.nix rename to homeManagerModules/neovim/langs/python/default.nix diff --git a/homeManagerModules/neovim/langs/rust.nix b/homeManagerModules/neovim/langs/rust/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/rust.nix rename to homeManagerModules/neovim/langs/rust/default.nix diff --git a/homeManagerModules/neovim/langs/web.nix b/homeManagerModules/neovim/langs/web/default.nix similarity index 100% rename from homeManagerModules/neovim/langs/web.nix rename to homeManagerModules/neovim/langs/web/default.nix diff --git a/homeManagerModules/neovim/plugins/heirline.lua b/homeManagerModules/neovim/theme/config/heirline.lua similarity index 100% rename from homeManagerModules/neovim/plugins/heirline.lua rename to homeManagerModules/neovim/theme/config/heirline.lua diff --git a/homeManagerModules/neovim/plugins/neotree.lua b/homeManagerModules/neovim/theme/config/neotree.lua similarity index 100% rename from homeManagerModules/neovim/plugins/neotree.lua rename to homeManagerModules/neovim/theme/config/neotree.lua diff --git a/homeManagerModules/neovim/theme.nix b/homeManagerModules/neovim/theme/default.nix similarity index 97% rename from homeManagerModules/neovim/theme.nix rename to homeManagerModules/neovim/theme/default.nix index 10123437..47bc18df 100644 --- a/homeManagerModules/neovim/theme.nix +++ b/homeManagerModules/neovim/theme/default.nix @@ -9,6 +9,8 @@ self: { cfg = config.programs.neovim; in { + imports = [./treesitter.nix]; + config.programs.neovim = { extraPackages = attrValues { inherit (pkgs) bat; @@ -96,14 +98,14 @@ in { { plugin = pkgs.vimPlugins.heirline-nvim; type = "lua"; - config = fileContents ./plugins/heirline.lua; + config = fileContents ./config/heirline.lua; } ] ++ optionals cfg.enableIde [ { plugin = pkgs.vimPlugins.neo-tree-nvim; type = "lua"; - config = fileContents ./plugins/neotree.lua; + config = fileContents ./config/neotree.lua; } { plugin = pkgs.vimPlugins.codewindow-nvim; diff --git a/homeManagerModules/neovim/treesitter.nix b/homeManagerModules/neovim/theme/treesitter.nix similarity index 100% rename from homeManagerModules/neovim/treesitter.nix rename to homeManagerModules/neovim/theme/treesitter.nix