diff --git a/docs/default.nix b/docs/default.nix index cce02b1d..4a9d2f8e 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -100,9 +100,11 @@ in { # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream # `nixosOptionsDoc` is more customizable. options.json = - pkgs.runCommand "options.json" { + pkgs.runCommand "options.json" + { meta.description = "List of nvf options in JSON format"; - } '' + } + '' mkdir -p $out/{share/doc,nix-support} cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf substitute \ @@ -115,13 +117,15 @@ in { # Generate the `man home-configuration.nix` package manPages = - pkgs.runCommand "nvf-reference-manpage" { + pkgs.runCommand "nvf-reference-manpage" + { nativeBuildInputs = [ pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs ]; allowedReferences = ["out"]; - } '' + } + '' # Generate manpages. mkdir -p $out/share/man/{man5,man1} diff --git a/flake.lock b/flake.lock index 377c0847..a39bf460 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "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": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -36,6 +52,21 @@ "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": { "locked": { "lastModified": 1726188505, @@ -98,11 +129,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726871744, - "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", + "lastModified": 1726142289, + "narHash": "sha256-Jks8O42La+nm5AMTSq/PvM5O+fUAhIy0Ce1QYqLkyZ4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", + "rev": "280db3decab4cbeb22a4599bd472229ab74d25e1", "type": "github" }, "original": { @@ -140,6 +171,22 @@ "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": { "flake": false, "locked": { @@ -1136,11 +1183,11 @@ "plugin-nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1727085470, - "narHash": "sha256-IPpUZEMIL7+4mmqQLy9JeT0cW15/SH3Hx8kyksVcqC0=", + "lastModified": 1716498901, + "narHash": "sha256-PMMqPDnq4Q8gWeKQ2WPE+pOf1R1G61wJ+bAWkHpQlzE=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "dd329912c8d446240584a2dbcd3802af3a19105a", + "rev": "b972e7154bc94ab4ecdbb38c8edbccac36f83996", "type": "github" }, "original": { @@ -1886,7 +1933,8 @@ "plugin-vim-vsnip": "plugin-vim-vsnip", "plugin-which-key": "plugin-which-key", "rnix-lsp": "rnix-lsp", - "systems": "systems_2" + "systems": "systems_2", + "zig": "zig" } }, "rust-overlay": { @@ -1958,6 +2006,26 @@ "repo": "flake-utils", "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", diff --git a/flake.nix b/flake.nix index c4996fcf..06849729 100644 --- a/flake.nix +++ b/flake.nix @@ -90,7 +90,10 @@ flake = false; }; - # Language servers (use master instead of nixpkgs) + # TODO: get zig from the zig overlay instead of nixpkgs + zig.url = "github:mitchellh/zig-overlay"; + + # Langauge server (use master instead of nixpkgs) rnix-lsp.url = "github:nix-community/rnix-lsp"; nil = { url = "github:oxalica/nil"; @@ -156,7 +159,7 @@ flake = false; }; - # Language support + # language support plugin-sqls-nvim = { url = "github:nanotee/sqls.nvim"; flake = false; diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index e6e718ed..dd1bde69 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -17,12 +17,12 @@ cfg = config.vim.languages.ts; - defaultServer = "ts_ls"; + defaultServer = "tsserver"; servers = { - ts_ls = { + tsserver = { package = pkgs.typescript-language-server; lspConfig = '' - lspconfig.ts_ls.setup { + lspconfig.tsserver.setup { capabilities = capabilities; on_attach = attach_keymaps, cmd = ${ @@ -49,24 +49,6 @@ } ''; }; - - # 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 @@ -83,7 +65,6 @@ ) ''; }; - prettierd = { package = pkgs.prettierd; nullConfig = '' @@ -113,7 +94,6 @@ }; }; in { - _file = ./ts.nix; options.vim.languages.ts = { enable = mkEnableOption "Typescript/Javascript language support"; @@ -210,32 +190,11 @@ in { }; }) - # Extensions (mkIf cfg.extensions."ts-error-translator".enable { vim.startPlugins = ["ts-error-translator"]; vim.pluginRC.ts-error-translator = entryAnywhere '' 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 for more details - about this change. - ''; - } - ]; - } ]); }