Compare commits

...

7 commits

Author SHA1 Message Date
Sizhe Zhao
3568897008 colorschemes/github-theme: set colorscheme
(cherry picked from commit 1787eeda5a)
2025-12-23 02:02:59 +00:00
nixvim-ci[bot]
204a2f3d35 flake: Update
flake.lock updates:
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/5635c32d666a59ec9a55cab87e898889869f7b71?narHash=sha256-MhA7wmo/7uogLxiewwRRmIax70g6q1U/YemqTGoFHlM%3D' (2025-12-11)
  → 'github:hercules-ci/flake-parts/a34fae9c08a15ad73f295041fec82323541400a9?narHash=sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw%3D' (2025-12-15)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/09eb77e94fa25202af8f3e81ddc7353d9970ac1b?narHash=sha256-mSD5Ob7a%2BT2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo%3D' (2025-12-09)
  → 'github:NixOS/nixpkgs/c6f52ebd45e5925c188d1a20119978aa4ffd5ef6?narHash=sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8%3D' (2025-12-15)

flake/dev/flake.lock updates:
• Updated input 'dev-nixpkgs':
    'github:NixOS/nixpkgs/09eb77e94fa25202af8f3e81ddc7353d9970ac1b?narHash=sha256-mSD5Ob7a%2BT2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo%3D' (2025-12-09)
  → 'github:NixOS/nixpkgs/c6f52ebd45e5925c188d1a20119978aa4ffd5ef6?narHash=sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8%3D' (2025-12-15)
• Updated input 'git-hooks':
    'github:cachix/git-hooks.nix/09e45f2598e1a8499c3594fe11ec2943f34fe509?narHash=sha256-dixPWKiHzh80PtD0aLuxYNQ0xP%2B843dfXG/yM3OzaYQ%3D' (2025-12-11)
  → 'github:cachix/git-hooks.nix/b68b780b69702a090c8bb1b973bab13756cc7a27?narHash=sha256-t3T/xm8zstHRLx%2BpIHxVpQTiySbKqcQbK%2Br%2B01XVKc0%3D' (2025-12-16)
• Updated input 'home-manager':
    'github:nix-community/home-manager/90b62096f099b73043a747348c11dbfcfbdea949?narHash=sha256-RM2xs%2B1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango%3D' (2025-12-13)
  → 'github:nix-community/home-manager/d3135ab747fd9dac250ffb90b4a7e80634eacbe9?narHash=sha256-/r9/1KamvbHJx6I40H4HsSXnEcBAkj46ZwibhBx9kg0%3D' (2025-12-17)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4?narHash=sha256-AlEObg0syDl%2BSpi4LsZIBrjw%2BsnSVU4T8MOeuZJUJjM%3D' (2025-11-12)
  → 'github:numtide/treefmt-nix/42d96e75aa56a3f70cab7e7dc4a32868db28e8fd?narHash=sha256-%2BcqN4PJz9y0JQXfAK5J1drd0U05D5fcAGhzhfVrDlsI%3D' (2025-12-17)
2025-12-20 18:51:18 +00:00
Matt Sturgeon
685d0be1fc docs/mdbook: refactor isVisible's "has visible" check
(cherry picked from commit 79ace278ec)
2025-12-17 20:09:24 +00:00
Matt Sturgeon
ce144adecb docs/mdbook: handle visible = "transparent"
(cherry picked from commit 5ef378a006)
2025-12-17 20:09:24 +00:00
Matt Sturgeon
d8c9d8451d modules/lsp/servers: simplify displayName and packageName
Move the `let in` block defining `displayName` and `packageName` up so
it doesn't have to deal with the module arg `name` shadowing `args.name`.

This simplifies the implementation and reduces repetition.

(cherry picked from commit 12a76dd12b)
2025-12-15 11:07:39 +00:00
Matt Sturgeon
2d088ea80a modules/lsp/servers: simplify activate default
The default for `lsp.servers.<name>.activate` used to be conditional on
whether `name == "*"`. This is leftover from before the * server was
moved to its own `global-server.nix` module and can now be removed.

(cherry picked from commit 753f7640d6)
2025-12-15 11:07:39 +00:00
Matt Sturgeon
f0b0cc7cae modules/lsp: move packages.nix from plugins.lsp
Move plugins/lsp/lsp-packages.nix -> modules/lsp/servers/packages.nix

(cherry picked from commit c97e8e3425)
2025-12-13 17:43:25 +00:00
12 changed files with 52 additions and 48 deletions

View file

@ -6,6 +6,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
name = "github-theme";
package = "github-nvim-theme";
isColorscheme = true;
colorscheme = "github_dark";
maintainers = [ lib.maintainers.GaetanLepage ];

View file

@ -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.

12
flake.lock generated
View file

@ -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": {

24
flake/dev/flake.lock generated
View file

@ -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": {

View file

@ -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
;

View file

@ -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;
};

View file

@ -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

View file

@ -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;

View file

@ -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")

View file

@ -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

View file

@ -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