diff --git a/modules/output.nix b/modules/output.nix index 3d7708e6..cce4aa38 100644 --- a/modules/output.nix +++ b/modules/output.nix @@ -87,19 +87,6 @@ in config = let - customRC = - (optionalString (config.extraConfigLuaPre != "") '' - ${config.extraConfigLuaPre} - '') + - (optionalString (config.extraConfigVim != "") '' - vim.cmd([[ - ${config.extraConfigVim} - ]]) - '') + - (optionalString (config.extraConfigLua != "" || config.extraConfigLuaPost != "") '' - ${config.extraConfigLua} - ${config.extraConfigLuaPost} - ''); defaultPlugin = { plugin = null; @@ -121,6 +108,25 @@ in { nixvim = { start = map (x: x.plugin) normalizedPlugins; opt = [ ]; }; }; }); + customRC = + '' + vim.cmd([[ + ${neovimConfig.neovimRcContent} + ]]) + '' + + (optionalString (config.extraConfigLuaPre != "") '' + ${config.extraConfigLuaPre} + '') + + (optionalString (config.extraConfigVim != "") '' + vim.cmd([[ + ${config.extraConfigVim} + ]]) + '') + + (optionalString (config.extraConfigLua != "" || config.extraConfigLuaPost != "") '' + ${config.extraConfigLua} + ${config.extraConfigLuaPost} + ''); + extraWrapperArgs = builtins.concatStringsSep " " ( (optional (config.extraPackages != [ ]) ''--prefix PATH : "${makeBinPath config.extraPackages}"'') @@ -136,6 +142,6 @@ in in { finalPackage = wrappedNeovim; - initContent = neovimConfig.neovimRcContent; + initContent = customRC; }; } diff --git a/tests/flake.lock b/tests/flake.lock index d8bc57a1..b4d67168 100644 --- a/tests/flake.lock +++ b/tests/flake.lock @@ -97,12 +97,12 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-p/xU46Ew3l56jrG0A+yeRLrOCxRMfAu3JBVvMP0bFUQ=", - "path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source", + "narHash": "sha256-7vhOkX4qovJR5Vm44lk6c81w3DkuGcQTRxGEnRJI8ro=", + "path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source", "type": "path" }, "original": { - "path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source", + "path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source", "type": "path" } }, @@ -116,12 +116,12 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-p/xU46Ew3l56jrG0A+yeRLrOCxRMfAu3JBVvMP0bFUQ=", - "path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source", + "narHash": "sha256-7vhOkX4qovJR5Vm44lk6c81w3DkuGcQTRxGEnRJI8ro=", + "path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source", "type": "path" }, "original": { - "path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source", + "path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source", "type": "path" } }, diff --git a/tests/flake.nix b/tests/flake.nix index 1b083b37..d611baa1 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -118,6 +118,88 @@ termguicolors = true; }; }; + + issue-65 = build { + colorschemes.gruvbox = { + enable = true; + contrastLight = "hard"; + contrastDark = "hard"; + }; + + options = { + number = true; + shiftwidth = 2; + tabstop = 2; + guifont = "FiraCode\ Nerd\ Font\ Mono:h14"; + }; + + plugins = { + lsp = { + enable = true; + servers.rnix-lsp.enable = true; + servers.rust-analyzer.enable = true; + servers.jsonls.enable = true; + }; + + nvim-tree = { + enable = true; + openOnSetup = true; + openOnTab = true; + }; + + telescope = { + enable = true; + }; + + nvim-cmp = { + formatting = { + format = '' + require("lspkind").cmp_format({ + mode="symbol", + maxwidth = 50, + ellipsis_char = "..." + }) + ''; + }; + + auto_enable_sources = true; + snippet = { + expand = '' + function(args) + require("luasnip").lsp_expand(args.body) + end + ''; + }; + enable = true; + sources = [ + { name = "nvim_lsp"; } + { + name = "luasnip"; + option = { + show_autosnippets = true; + }; + } + { name = "path"; } + { name = "buffer"; } + ]; + + }; + barbar.enable = true; + }; + + globals.mapleader = " "; + extraPlugins = with pkgs.vimPlugins; [ + which-key-nvim + # leap-nvim + vim-flutter + plenary-nvim + fidget-nvim + luasnip + lspkind-nvim + ]; + + # extraConfigLua = (builtins.readFile ./nvim-extra-lua.lua); + }; }; })) // { nixosConfigurations.nixvim-machine = nixpkgs.lib.nixosSystem {