diff --git a/colorschemes/github-theme/default.nix b/colorschemes/github-theme/default.nix index 490a8a49..f80c35b0 100644 --- a/colorschemes/github-theme/default.nix +++ b/colorschemes/github-theme/default.nix @@ -6,6 +6,7 @@ lib.nixvim.plugins.mkNeovimPlugin { name = "github-theme"; package = "github-nvim-theme"; isColorscheme = true; + colorscheme = "github_dark"; maintainers = [ lib.maintainers.GaetanLepage ]; diff --git a/docs/mdbook/default.nix b/docs/mdbook/default.nix index 6d1e27fa..1729be76 100644 --- a/docs/mdbook/default.nix +++ b/docs/mdbook/default.nix @@ -48,35 +48,39 @@ let removeWhitespace = builtins.replaceStrings [ " " ] [ "" ]; getSubOptions = - opts: path: - lib.optionalAttrs (isDeeplyVisible opts) (removeUnwanted (opts.type.getSubOptions path)); + opt: + let + visible = opt.visible or true; + visible' = if lib.isBool visible then visible else visible != "shallow"; + subOpts = opt.type.getSubOptions opt.loc; + in + lib.optionalAttrs visible' (removeUnwanted subOpts); - isVisible = isVisibleWith true; - isDeeplyVisible = isVisibleWith false; - - isVisibleWith = - shallow: opts: + isVisible = let test = opt: let internal = opt.internal or false; visible = opt.visible or true; - visible' = if visible == "shallow" then shallow else visible; + visible' = if lib.isBool visible then visible else visible != "transparent"; in visible' && !internal; + + # FIXME: isVisible is not a perfect check; + # it will false-positive on `visible = "transparent"` + hasVisible = opts: lib.any (v: lib.isAttrs v -> isVisible v) (lib.attrValues opts); in + opts: if lib.isOption opts then test opts else if opts.isOption then test opts.index.options else - let - filterFunc = lib.filterAttrs (_: v: if lib.isAttrs v then isVisibleWith shallow v else true); - hasEmptyIndex = (filterFunc opts.index.options) == { }; - hasEmptyComponents = (filterFunc opts.components) == { }; - in - !hasEmptyIndex || !hasEmptyComponents; + lib.any hasVisible [ + opts.index.options + opts.components + ]; wrapOptionDocPage = path: opts: isOpt: rec { index = { @@ -136,7 +140,7 @@ let wrapOptionDocPage (path ++ [ name ]) (go (path ++ [ name ]) opts) false else let - subOpts = getSubOptions opts (path ++ [ name ]); + subOpts = getSubOptions opts; in # If this node is an option with sub-options... # Pass wrapOptionDocPage a set containing it and its sub-options. @@ -144,7 +148,7 @@ let if subOpts != { } then wrapOptionDocPage (path ++ [ name ]) ( (go (path ++ [ name ]) subOpts) - // { + // lib.optionalAttrs (isVisible opts) { # This is necessary to include the option itself in the docs. # For instance, this helps submodules like "autoCmd" to include their base declaration in the docs. # Though there must be a better, less "hacky" solution than this. diff --git a/flake.lock b/flake.lock index bc43bc2e..24dee844 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1765495779, - "narHash": "sha256-MhA7wmo/7uogLxiewwRRmIax70g6q1U/YemqTGoFHlM=", + "lastModified": 1765835352, + "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "5635c32d666a59ec9a55cab87e898889869f7b71", + "rev": "a34fae9c08a15ad73f295041fec82323541400a9", "type": "github" }, "original": { @@ -66,11 +66,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1765311797, - "narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=", + "lastModified": 1765838191, + "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b", + "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6", "type": "github" }, "original": { diff --git a/flake/dev/flake.lock b/flake/dev/flake.lock index 479b3028..6f2d3b8d 100644 --- a/flake/dev/flake.lock +++ b/flake/dev/flake.lock @@ -2,11 +2,11 @@ "nodes": { "dev-nixpkgs": { "locked": { - "lastModified": 1765311797, - "narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=", + "lastModified": 1765838191, + "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b", + "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6", "type": "github" }, "original": { @@ -63,11 +63,11 @@ ] }, "locked": { - "lastModified": 1765464257, - "narHash": "sha256-dixPWKiHzh80PtD0aLuxYNQ0xP+843dfXG/yM3OzaYQ=", + "lastModified": 1765911976, + "narHash": "sha256-t3T/xm8zstHRLx+pIHxVpQTiySbKqcQbK+r+01XVKc0=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "09e45f2598e1a8499c3594fe11ec2943f34fe509", + "rev": "b68b780b69702a090c8bb1b973bab13756cc7a27", "type": "github" }, "original": { @@ -104,11 +104,11 @@ ] }, "locked": { - "lastModified": 1765605144, - "narHash": "sha256-RM2xs+1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango=", + "lastModified": 1765979862, + "narHash": "sha256-/r9/1KamvbHJx6I40H4HsSXnEcBAkj46ZwibhBx9kg0=", "owner": "nix-community", "repo": "home-manager", - "rev": "90b62096f099b73043a747348c11dbfcfbdea949", + "rev": "d3135ab747fd9dac250ffb90b4a7e80634eacbe9", "type": "github" }, "original": { @@ -157,11 +157,11 @@ ] }, "locked": { - "lastModified": 1762938485, - "narHash": "sha256-AlEObg0syDl+Spi4LsZIBrjw+snSVU4T8MOeuZJUJjM=", + "lastModified": 1766000401, + "narHash": "sha256-+cqN4PJz9y0JQXfAK5J1drd0U05D5fcAGhzhfVrDlsI=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4", + "rev": "42d96e75aa56a3f70cab7e7dc4a32868db28e8fd", "type": "github" }, "original": { diff --git a/modules/lsp/servers/default.nix b/modules/lsp/servers/default.nix index 3427f81d..67cb5244 100644 --- a/modules/lsp/servers/default.nix +++ b/modules/lsp/servers/default.nix @@ -60,11 +60,11 @@ let default = { }; }; - # Combine `packages` and `customCmd` sets from `lsp-packages.nix` + # Combine `packages` and `customCmd` sets from `packages.nix` # We use this set to generate the package-option defaults serverPackages = let - inherit (import ../../../plugins/lsp/lsp-packages.nix) + inherit (import ./packages.nix) packages customCmd ; diff --git a/plugins/lsp/lsp-packages.nix b/modules/lsp/servers/packages.nix similarity index 100% rename from plugins/lsp/lsp-packages.nix rename to modules/lsp/servers/packages.nix diff --git a/modules/lsp/servers/server.nix b/modules/lsp/servers/server.nix index 3feaa6bc..86f6d46a 100644 --- a/modules/lsp/servers/server.nix +++ b/modules/lsp/servers/server.nix @@ -4,6 +4,10 @@ package ? null, config ? null, }@args: +let + displayName = name; + packageName = package.name or args.name or "language server"; +in { lib, name, @@ -13,8 +17,6 @@ }: let inherit (lib) types; - displayName = args.name or "the language server"; - packageName = package.name or (lib.strings.removePrefix "the " displayName); in { options = { @@ -36,10 +38,7 @@ in description = '' Whether to call `vim.lsp.enable()` for ${displayName}. ''; - default = config.name != "*"; - defaultText = lib.literalMD '' - `true`, unless the server's `name` is `*` - ''; + default = true; example = false; }; diff --git a/plugins/lsp/language-servers/default.nix b/plugins/lsp/language-servers/default.nix index a07c4445..fa11d1bf 100644 --- a/plugins/lsp/language-servers/default.nix +++ b/plugins/lsp/language-servers/default.nix @@ -220,7 +220,7 @@ let }; }; - lspPackages = import ../lsp-packages.nix; + lspPackages = import ../../../modules/lsp/servers/packages.nix; generatedServers = lib.pipe ../../../generated/lspconfig-servers.json [ lib.importJSON diff --git a/tests/generated.nix b/tests/generated.nix index 5b80ea90..31520809 100644 --- a/tests/generated.nix +++ b/tests/generated.nix @@ -45,11 +45,11 @@ let errors = lib.concatStringsSep "\n" ( checkDeclarations ( let - inherit (import ../plugins/lsp/lsp-packages.nix) unpackaged packages customCmd; + inherit (import ../modules/lsp/servers/packages.nix) unpackaged packages customCmd; in { name = "lsp"; - declarationFile = "plugins/lsp/lsp-packages.nix"; + declarationFile = "modules/lsp/servers/packages.nix"; packages = builtins.attrValues packages; diff --git a/tests/test-sources/modules/lsp.nix b/tests/test-sources/modules/lsp.nix index 7bdaee08..b0e839a2 100644 --- a/tests/test-sources/modules/lsp.nix +++ b/tests/test-sources/modules/lsp.nix @@ -272,7 +272,7 @@ packageOpt = (serverOpt.type.getSubOptions serverOpt.loc).package; # The lua_ls package attr to remove from pkgs - packageName = lib.pipe ../../../plugins/lsp/lsp-packages.nix [ + packageName = lib.pipe ../../../modules/lsp/servers/packages.nix [ import (lib.getAttr "packages") (lib.getAttr "lua_ls") diff --git a/typos.toml b/typos.toml index 863ad310..5d197503 100644 --- a/typos.toml +++ b/typos.toml @@ -13,7 +13,7 @@ Highligt = "Highligt" # TODO: ./plugins/utils/neogen.nix Annote = "Annote" # TODO: ./plugins/lsp/fidget.nix ket = "ket" # ./plugins/utils/sandwich.nix tro = "tro" # ./plugins/utils/spectre.nix -protols = "protols" # ./plugins/lsp/lsp-packages.nix +protols = "protols" # ./modules/lsp/servers/packages.nix compatibilty = "compatibilty" # ./plugins/by-name/visual-multi/default.nix Maco = "Maco" # ./plugins/by-name/femaco diff --git a/version-info.toml b/version-info.toml index ae64a2b8..57bfe252 100644 --- a/version-info.toml +++ b/version-info.toml @@ -1,6 +1,6 @@ # DO NOT MODIFY! # This file was generated by ci/version-info/default.nix -nixpkgs_rev = "09eb77e94fa25202af8f3e81ddc7353d9970ac1b" +nixpkgs_rev = "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6" release = "25.11" unstable = false