Skip to content

Commit

Permalink
flake(update): update nixpkgs, use lua highlight
Browse files Browse the repository at this point in the history
Updates nixpkgs & use the new treesitter dynamic language injection via
comments for lua strings (see nvim-treesitter/nvim-treesitter#4658)

Also updates nil and points it back to oxalica's master
  • Loading branch information
jordanisaacs committed Oct 21, 2023
1 parent d0c4d99 commit 87ad58e
Show file tree
Hide file tree
Showing 36 changed files with 69 additions and 65 deletions.
16 changes: 8 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
rnix-lsp.inputs.nixpkgs.follows = "flake-utils";
rnix-lsp.inputs.utils.follows = "flake-utils";

nil.url = "github:jordanisaacs/nil";
nil.url = "github:oxalica/nil";
nil.inputs.nixpkgs.follows = "nixpkgs";
nil.inputs.flake-utils.follows = "flake-utils";

Expand Down
2 changes: 1 addition & 1 deletion modules/autopairs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ in
{
vim.startPlugins = [ "nvim-autopairs" ];

vim.luaConfigRC.autopairs = nvim.dag.entryAnywhere ''
vim.luaConfigRC.autopairs = nvim.dag.entryAnywhere /* lua */ ''
require("nvim-autopairs").setup{}
'';
};
Expand Down
2 changes: 1 addition & 1 deletion modules/build/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ in
config =
let
buildPlug = name:
pkgs.vimUtils.buildVimPluginFrom2Nix rec {
pkgs.vimUtils.buildVimPlugin rec {
pname = name;
version = "master";
src =
Expand Down
2 changes: 1 addition & 1 deletion modules/chatgpt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in {

config = mkIf cfg.enable {
vim.startPlugins = ["nui-nvim" "chatgpt-nvim"];
vim.luaConfigRC.chatgptnvim = nvim.dag.entryAnywhere ''
vim.luaConfigRC.chatgptnvim = nvim.dag.entryAnywhere /* lua */ ''
require'chatgpt'.setup({ ${cfg.config} })
'';
};
Expand Down
2 changes: 1 addition & 1 deletion modules/completion/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ in
"path" = "[Path]";
};

vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement ''
vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement /* lua */ ''
local nvim_cmp_menu_map = function(entry, vim_item)
-- name for each source
vim_item.menu = ({
Expand Down
10 changes: 6 additions & 4 deletions modules/debugger/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in
{
vim.startPlugins = [ "nvim-dap" ];

vim.luaConfigRC.dap-setup = nvim.dag.entryAnywhere ''
vim.luaConfigRC.dap-setup = nvim.dag.entryAnywhere /* lua */ ''
local dap = require('dap')
local codelldb_bin = "${cfg.package}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb"
Expand Down Expand Up @@ -64,20 +64,22 @@ in
(mkIf cfg.virtualText.enable {
vim.startPlugins = [ "nvim-dap-virtual-text" ];

vim.luaConfigRC.dap-virtual-text = nvim.dag.entryAnywhere ''
vim.luaConfigRC.dap-virtual-text = nvim.dag.entryAnywhere /* lua */ ''
require("nvim-dap-virtual-text").setup()
'';
})
(mkIf cfg.ui.enable {
vim.startPlugins = [ "nvim-dap-ui" ];

vim.luaConfigRC.dap-ui = nvim.dag.entryAfter [ "dap-setup" ] (''
vim.luaConfigRC.dap-ui = nvim.dag.entryAfter [ "dap-setup" ] ((
/* lua */ ''
local dapui = require"dapui"
dapui.setup()
vim.keymap.set("n", "<leader>du", dapui.toggle)
''
+ (optionalString cfg.ui.autoOpen ''
)
+ (optionalString cfg.ui.autoOpen /* lua */ ''
-- TODO: move these into generic events
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
Expand Down
2 changes: 1 addition & 1 deletion modules/filetree/nvimtreelua.nix
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ in
"<leader>tf" = ":NvimTreeFocus<CR>";
};

vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere ''
vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere /* lua */ ''
require'nvim-tree'.setup({
disable_netrw = ${boolToString cfg.disableNetRW},
hijack_netrw = ${boolToString cfg.hijackNetRW},
Expand Down
2 changes: 1 addition & 1 deletion modules/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ in
{
vim.startPlugins = [ "gitsigns-nvim" ];

vim.luaConfigRC.gitsigns = nvim.dag.entryAnywhere ''
vim.luaConfigRC.gitsigns = nvim.dag.entryAnywhere /* lua */ ''
require('gitsigns').setup {
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
Expand Down
4 changes: 3 additions & 1 deletion modules/keys/which-key.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ in
config = mkIf (cfg.enable && cfg.whichKey.enable) {
vim.startPlugins = [ "which-key" ];

vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere ''local wk = require("which-key").setup {}'';
vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere /* lua */ ''
local wk = require("which-key").setup {}
'';
};
}
6 changes: 3 additions & 3 deletions modules/languages/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with builtins; let
servers = {
bashls = {
package = [ "nodePackages" "bash-language-server" ];
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.bashls.setup{
capabilities = capabilities;
on_attach = default_on_attach;
Expand All @@ -25,7 +25,7 @@ with builtins; let
formats = {
shfmt = {
package = [ "shfmt" ];
nullConfig = ''
nullConfig = /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.formatting.shfmt.with({
Expand All @@ -40,7 +40,7 @@ with builtins; let
diagnostics = {
shellcheck = {
package = pkgs.shellcheck;
nullConfig = pkg: ''
nullConfig = pkg: /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.diagnostics.shellcheck.with({
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/clang.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with builtins; let
servers = {
ccls = {
package = [ "ccls" ];
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.ccls.setup{
capabilities = capabilities;
on_attach=default_on_attach;
Expand All @@ -23,7 +23,7 @@ with builtins; let

clangd = {
package = [ "clang-tools" ];
lspConfig = lib.warnIf (cfg.lsp.opts != null) "clangd does not use lsp.opts" ''
lspConfig = lib.warnIf (cfg.lsp.opts != null) "clangd does not use lsp.opts" /* lua */ ''
lspconfig.ccls.setup{
capabilities = capabilities;
on_attach=default_on_attach;
Expand Down Expand Up @@ -110,7 +110,7 @@ in

vim.startPlugins = [ "ccls-nvim" ];

vim.luaConfigRC.ccls-nvim = nvim.dag.entryAnywhere ''
vim.luaConfigRC.ccls-nvim = nvim.dag.entryAnywhere /* lua */ ''
require("ccls").setup({})
'';
})
Expand Down
2 changes: 1 addition & 1 deletion modules/languages/html.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ in

vim.startPlugins = optional cfg.treesitter.autotagHtml "nvim-ts-autotag";

vim.luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (nvim.dag.entryAnywhere ''
vim.luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (nvim.dag.entryAnywhere /* lua */ ''
require('nvim-ts-autotag').setup()
'');
})
Expand Down
2 changes: 1 addition & 1 deletion modules/languages/markdown.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ in
(mkIf cfg.glow.enable {
vim.startPlugins = [ "glow-nvim" ];

vim.luaConfigRC.glow = nvim.dag.entryAnywhere ''
vim.luaConfigRC.glow = nvim.dag.entryAnywhere /* lua */ ''
require'glow'.setup({
glow_path = "${pkgs.glow}/bin/glow",
})
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ with builtins; let
rnix = {
package = [ "rnix-lsp" ];
internalFormatter = cfg.format.type == "nixpkgs-fmt";
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.rnix.setup{
capabilities = capabilities,
${
Expand All @@ -31,7 +31,7 @@ with builtins; let
nil = {
package = [ "nil" ];
internalFormatter = true;
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.nil_ls.setup{
capabilities = capabilities,
${
Expand Down Expand Up @@ -67,7 +67,7 @@ with builtins; let
formats = {
alejandra = {
package = [ "alejandra" ];
nullConfig = ''
nullConfig = /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.formatting.alejandra.with({
Expand Down
4 changes: 2 additions & 2 deletions modules/languages/python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with builtins; let
servers = {
pyright = {
package = [ "nodePackages" "pyright" ];
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.pyright.setup{
capabilities = capabilities;
on_attach = default_on_attach;
Expand All @@ -25,7 +25,7 @@ with builtins; let
formats = {
black = {
package = [ "black" ];
nullConfig = ''
nullConfig = /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.formatting.black.with({
Expand Down
4 changes: 2 additions & 2 deletions modules/languages/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ in
vim.startPlugins = [ "crates-nvim" ];

vim.autocomplete.sources = { "crates" = "[Crates]"; };
vim.luaConfigRC.rust-crates = nvim.dag.entryAnywhere ''
vim.luaConfigRC.rust-crates = nvim.dag.entryAnywhere /* lua */ ''
require('crates').setup {
null_ls = {
enabled = ${boolToString cfg.crates.codeActions},
Expand All @@ -89,7 +89,7 @@ in
vim.startPlugins = [ "rust-tools" ];

vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.rust-lsp = ''
vim.lsp.lspconfig.sources.rust-lsp = /* lua */ ''
local rt = require('rust-tools')
rust_on_attach = function(client, bufnr)
Expand Down
2 changes: 1 addition & 1 deletion modules/languages/sclang.nix
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ in {
vim.startPlugins = [
"scnvim"
];
vim.luaConfigRC.scnvim = nvim.dag.entryAnywhere ''
vim.luaConfigRC.scnvim = nvim.dag.entryAnywhere /* lua */ ''
local scnvim = require 'scnvim'
local map = scnvim.map
local map_expr = scnvim.map_expr
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/sql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ with builtins; let
servers = {
sqls = {
package = [ "sqls" ];
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.sqls.setup {
on_attach = function(client, bufnr)
client.server_capabilities.execute_command = true
Expand All @@ -29,7 +29,7 @@ with builtins; let
formats = {
sqlfluff = {
package = [ sqlfluffDefault ];
nullConfig = ''
nullConfig = /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.formatting.sqlfluff.with({
Expand All @@ -45,7 +45,7 @@ with builtins; let
diagnostics = {
sqlfluff = {
package = pkgs.${sqlfluffDefault};
nullConfig = pkg: ''
nullConfig = pkg: /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.diagnostics.sqlfluff.with({
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/ts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with builtins; let
servers = {
tsserver = {
package = [ "nodePackages" "typescript-language-server" ];
lspConfig = ''
lspConfig = /* lua */ ''
lspconfig.tsserver.setup {
capabilities = capabilities;
on_attach = attach_keymaps,
Expand All @@ -26,7 +26,7 @@ with builtins; let
formats = {
prettier = {
package = [ "nodePackages" "prettier" ];
nullConfig = ''
nullConfig = /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.formatting.prettier.with({
Expand All @@ -42,7 +42,7 @@ with builtins; let
diagnostics = {
eslint = {
package = pkgs.nodePackages.eslint;
nullConfig = pkg: ''
nullConfig = pkg: /* lua */ ''
table.insert(
ls_sources,
null_ls.builtins.diagnostics.eslint.with({
Expand Down
2 changes: 1 addition & 1 deletion modules/languages/zig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ in

(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.zig-lsp = ''
vim.lsp.lspconfig.sources.zig-lsp = /* lua */ ''
lspconfig.zls.setup {
capabilities = capabilities,
on_attach=default_on_attach,
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in

vim.autocomplete.sources = { "nvim_lsp" = "[LSP]"; };

vim.luaConfigRC.lsp-setup = ''
vim.luaConfigRC.lsp-setup = /* lua */ ''
vim.g.formatsave = ${boolToString cfg.formatOnSave};
local attach_keymaps = function(client, bufnr)
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/fidget.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in
config = mkIf (cfg.enable && cfg.fidget.enable) {
vim.startPlugins = [ "fidget" ];

vim.luaConfigRC.fidget = nvim.dag.entryAnywhere ''
vim.luaConfigRC.fidget = nvim.dag.entryAnywhere /* lua */ ''
-- Enable fidget
require'fidget'.setup()
'';
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/lightbulb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in
autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()
'';

vim.luaConfigRC.lightbulb = nvim.dag.entryAnywhere ''
vim.luaConfigRC.lightbulb = nvim.dag.entryAnywhere /* lua */ ''
-- Enable trouble diagnostics viewer
require'nvim-lightbulb'.setup()
'';
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/lsp-signature.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in
config = mkIf (cfg.enable && cfg.lspSignature.enable) {
vim.startPlugins = [ "lsp-signature" ];

vim.luaConfigRC.lsp-signature = nvim.dag.entryAnywhere ''
vim.luaConfigRC.lsp-signature = nvim.dag.entryAnywhere /* lua */ ''
-- Enable lsp signature viewer
require("lsp_signature").setup()
'';
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/lspconfig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ in

vim.startPlugins = [ "nvim-lspconfig" ];

vim.luaConfigRC.lspconfig = nvim.dag.entryAfter [ "lsp-setup" ] ''
vim.luaConfigRC.lspconfig = nvim.dag.entryAfter [ "lsp-setup" ] /* lua */ ''
local lspconfig = require('lspconfig')
'';
}
Expand Down

0 comments on commit 87ad58e

Please sign in to comment.