mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-02-17 22:12:55 +01:00
Compare commits
4 commits
57be605ed4
...
316f25a0f6
Author | SHA1 | Date | |
---|---|---|---|
316f25a0f6 | |||
842b45b969 | |||
27b3524508 | |||
a85ac83182 |
4 changed files with 57 additions and 91 deletions
|
@ -100,11 +100,9 @@ in {
|
||||||
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
||||||
# `nixosOptionsDoc` is more customizable.
|
# `nixosOptionsDoc` is more customizable.
|
||||||
options.json =
|
options.json =
|
||||||
pkgs.runCommand "options.json"
|
pkgs.runCommand "options.json" {
|
||||||
{
|
|
||||||
meta.description = "List of nvf options in JSON format";
|
meta.description = "List of nvf options in JSON format";
|
||||||
}
|
} ''
|
||||||
''
|
|
||||||
mkdir -p $out/{share/doc,nix-support}
|
mkdir -p $out/{share/doc,nix-support}
|
||||||
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf
|
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf
|
||||||
substitute \
|
substitute \
|
||||||
|
@ -117,15 +115,13 @@ in {
|
||||||
|
|
||||||
# Generate the `man home-configuration.nix` package
|
# Generate the `man home-configuration.nix` package
|
||||||
manPages =
|
manPages =
|
||||||
pkgs.runCommand "nvf-reference-manpage"
|
pkgs.runCommand "nvf-reference-manpage" {
|
||||||
{
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgs.buildPackages.installShellFiles
|
pkgs.buildPackages.installShellFiles
|
||||||
pkgs.nixos-render-docs
|
pkgs.nixos-render-docs
|
||||||
];
|
];
|
||||||
allowedReferences = ["out"];
|
allowedReferences = ["out"];
|
||||||
}
|
} ''
|
||||||
''
|
|
||||||
# Generate manpages.
|
# Generate manpages.
|
||||||
mkdir -p $out/share/man/{man5,man1}
|
mkdir -p $out/share/man/{man5,man1}
|
||||||
|
|
||||||
|
|
82
flake.lock
generated
82
flake.lock
generated
|
@ -1,21 +1,5 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1673956053,
|
|
||||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
@ -52,21 +36,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1659877975,
|
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726188505,
|
"lastModified": 1726188505,
|
||||||
|
@ -129,11 +98,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726142289,
|
"lastModified": 1726871744,
|
||||||
"narHash": "sha256-Jks8O42La+nm5AMTSq/PvM5O+fUAhIy0Ce1QYqLkyZ4=",
|
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "280db3decab4cbeb22a4599bd472229ab74d25e1",
|
"rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -171,22 +140,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1702350026,
|
|
||||||
"narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "9463103069725474698139ab10f17a9d125da859",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-23.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nmd": {
|
"nmd": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1183,11 +1136,11 @@
|
||||||
"plugin-nvim-lspconfig": {
|
"plugin-nvim-lspconfig": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716498901,
|
"lastModified": 1727085470,
|
||||||
"narHash": "sha256-PMMqPDnq4Q8gWeKQ2WPE+pOf1R1G61wJ+bAWkHpQlzE=",
|
"narHash": "sha256-IPpUZEMIL7+4mmqQLy9JeT0cW15/SH3Hx8kyksVcqC0=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "nvim-lspconfig",
|
"repo": "nvim-lspconfig",
|
||||||
"rev": "b972e7154bc94ab4ecdbb38c8edbccac36f83996",
|
"rev": "dd329912c8d446240584a2dbcd3802af3a19105a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1933,8 +1886,7 @@
|
||||||
"plugin-vim-vsnip": "plugin-vim-vsnip",
|
"plugin-vim-vsnip": "plugin-vim-vsnip",
|
||||||
"plugin-which-key": "plugin-which-key",
|
"plugin-which-key": "plugin-which-key",
|
||||||
"rnix-lsp": "rnix-lsp",
|
"rnix-lsp": "rnix-lsp",
|
||||||
"systems": "systems_2",
|
"systems": "systems_2"
|
||||||
"zig": "zig"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
|
@ -2006,26 +1958,6 @@
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"zig": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": "nixpkgs_3"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716725305,
|
|
||||||
"narHash": "sha256-LIz08gALt2wlutGXAEhNroEoIuPV5ePQB8LI4WzXcy8=",
|
|
||||||
"owner": "mitchellh",
|
|
||||||
"repo": "zig-overlay",
|
|
||||||
"rev": "93b02a697561ecd438cfa5779727b5a1c300cb4c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "mitchellh",
|
|
||||||
"repo": "zig-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
@ -90,10 +90,7 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: get zig from the zig overlay instead of nixpkgs
|
# Language servers (use master instead of nixpkgs)
|
||||||
zig.url = "github:mitchellh/zig-overlay";
|
|
||||||
|
|
||||||
# Langauge server (use master instead of nixpkgs)
|
|
||||||
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
||||||
nil = {
|
nil = {
|
||||||
url = "github:oxalica/nil";
|
url = "github:oxalica/nil";
|
||||||
|
@ -159,7 +156,7 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# language support
|
# Language support
|
||||||
plugin-sqls-nvim = {
|
plugin-sqls-nvim = {
|
||||||
url = "github:nanotee/sqls.nvim";
|
url = "github:nanotee/sqls.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.ts;
|
cfg = config.vim.languages.ts;
|
||||||
|
|
||||||
defaultServer = "tsserver";
|
defaultServer = "ts_ls";
|
||||||
servers = {
|
servers = {
|
||||||
tsserver = {
|
ts_ls = {
|
||||||
package = pkgs.typescript-language-server;
|
package = pkgs.typescript-language-server;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.tsserver.setup {
|
lspconfig.ts_ls.setup {
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
on_attach = attach_keymaps,
|
on_attach = attach_keymaps,
|
||||||
cmd = ${
|
cmd = ${
|
||||||
|
@ -49,6 +49,24 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Here for backwards compatibility. Still consider tsserver a valid
|
||||||
|
# configuration in the enum, but assert if it's set to *properly*
|
||||||
|
# redirect the user to the correct server.
|
||||||
|
tsserver = {
|
||||||
|
package = pkgs.typescript-language-server;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.ts_ls.setup {
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = attach_keymaps,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/typescript-language-server", "--stdio"}''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: specify packages
|
# TODO: specify packages
|
||||||
|
@ -65,6 +83,7 @@
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
prettierd = {
|
prettierd = {
|
||||||
package = pkgs.prettierd;
|
package = pkgs.prettierd;
|
||||||
nullConfig = ''
|
nullConfig = ''
|
||||||
|
@ -94,6 +113,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
_file = ./ts.nix;
|
||||||
options.vim.languages.ts = {
|
options.vim.languages.ts = {
|
||||||
enable = mkEnableOption "Typescript/Javascript language support";
|
enable = mkEnableOption "Typescript/Javascript language support";
|
||||||
|
|
||||||
|
@ -190,11 +210,32 @@ in {
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Extensions
|
||||||
(mkIf cfg.extensions."ts-error-translator".enable {
|
(mkIf cfg.extensions."ts-error-translator".enable {
|
||||||
vim.startPlugins = ["ts-error-translator"];
|
vim.startPlugins = ["ts-error-translator"];
|
||||||
vim.pluginRC.ts-error-translator = entryAnywhere ''
|
vim.pluginRC.ts-error-translator = entryAnywhere ''
|
||||||
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Warn the user if they have set the default server name to tsserver to match upstream (us)
|
||||||
|
# The name "tsserver" has been deprecated in lspconfig, and now should be called ts_ls. This
|
||||||
|
# is a purely cosmetic change, but emits a warning if not accounted for.
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.lsp.enable -> cfg.lsp.server != "tsserver";
|
||||||
|
message = ''
|
||||||
|
As of a recent lspconfig update, he `tsserver` configuration has been renamed
|
||||||
|
to `ts_ls` to match upstream behaviour of `lspconfig`, and the name `tsserver`
|
||||||
|
is no longer considered valid by nvf. Please set `vim.languages.ts.lsp.server`
|
||||||
|
to `"ts_ls"` instead of to `${cfg.lsp.server}`
|
||||||
|
|
||||||
|
Please see <https://github.com/neovim/nvim-lspconfig/pull/3232> for more details
|
||||||
|
about this change.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue