diff --git a/configuration.nix b/configuration.nix index 3d01b41..6b3b2f3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,7 +4,7 @@ ./hardware-configuration.nix ./easyroam.nix ./stylix.nix - ./nixvim/nixvim.nix + ./nixvim.nix ]; boot.loader.systemd-boot.enable = true; diff --git a/flake.nix b/flake.nix index f624c05..2c9e9ee 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,7 @@ nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { modules = [ ./configuration.nix - ./nixvim/nixvim.nix + ./nixvim.nix nix-easyroam.nixosModules.nix-easyroam stylix.nixosModules.stylix nixvim.nixosModules.nixvim diff --git a/home/home.nix b/home/home.nix index 03350ab..fdfb729 100644 --- a/home/home.nix +++ b/home/home.nix @@ -9,6 +9,7 @@ imports = [ ./stylix.nix inputs.nixcord.homeModules.nixcord + inputs.nixvim.homeModules.nixvim ]; # Home Manager needs a bit of information about you and the # paths it should manage. diff --git a/nixvim/plugins.nix b/nixvim.nix similarity index 51% rename from nixvim/plugins.nix rename to nixvim.nix index 9d07e42..fcbe839 100644 --- a/nixvim/plugins.nix +++ b/nixvim.nix @@ -1,11 +1,45 @@ { - lib, config, + lib, pkgs, ... }: { programs.nixvim = { + enable = true; + extraConfigLuaPost = '' + local map = vim.keymap.set + for i = 1, 10 do + map('n', '', ' LualineBuffersJump! ' .. i .. '') + end + ''; + opts = { + relativenumber = true; + tabstop = 8; + shiftwidth = 8; + expandtab = true; + swapfile = false; + }; + extraPackages = with pkgs; [ + nixfmt + ]; + lsp = { + inlayHints.enable = true; + servers = { + clangd.enable = true; + qmlls.enable = true; + lua-language-server.enable = true; + rust_analyzer.enable = true; + nixd = { + enable = true; + config = { + formatting = { + command = "nixfmt"; + }; + }; + }; + }; + }; plugins = { lspconfig.enable = true; blink-cmp = { @@ -68,6 +102,35 @@ }; }; }; + globals = { + mapleader = " "; + }; + diagnostic = { + settings = { + virtual_text = { + spacing = 4; + source = true; + }; + }; + }; + keymaps = [ + { + key = ""; + action = " lua vim.lsp.buf.format() "; + } + { + key = "t"; + action = " terminal "; + } + { + key = ""; + action = ""; + mode = "t"; + } + { + key = ""; + action = " lua bdelete! "; + } + ]; }; - } diff --git a/nixvim/keymaps.nix b/nixvim/keymaps.nix deleted file mode 100644 index 0609ab5..0000000 --- a/nixvim/keymaps.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - programs.nixvim = { - keymaps = [ - { - key = ""; - action = " lua vim.lsp.buf.format() "; - } - { - key = "t"; - action = " terminal "; - } - { - key = ""; - action = ""; - mode = "t"; - } - { - key = ""; - action = " lua bdelete! "; - } - ]; - }; -} diff --git a/nixvim/nixvim.nix b/nixvim/nixvim.nix deleted file mode 100644 index 63c405c..0000000 --- a/nixvim/nixvim.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - imports = [ - ./plugins.nix - ./keymaps.nix - ]; - programs.nixvim = { - enable = true; - extraConfigLuaPost = '' - local map = vim.keymap.set - for i = 1, 10 do - map('n', '', ' LualineBuffersJump! ' .. i .. '') - end - ''; - opts = { - relativenumber = true; - tabstop = 8; - shiftwidth = 8; - expandtab = true; - swapfile = false; - }; - extraPackages = with pkgs; [ - nixfmt - ]; - lsp = { - inlayHints.enable = true; - servers = { - clangd.enable = true; - qmlls.enable = true; - lua-language-server.enable = true; - rust_analyzer.enable = true; - nixd = { - enable = true; - config = { - formatting = { - command = "nixfmt"; - }; - }; - }; - }; - }; - globals = { - mapleader = " "; - }; - diagnostic = { - settings = { - virtual_text = { - spacing = 4; - source = true; - }; - }; - }; - }; -}