Compare commits
7 commits
844cb1c1b7
...
3568897008
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3568897008 | ||
|
|
204a2f3d35 | ||
|
|
685d0be1fc | ||
|
|
ce144adecb | ||
|
|
d8c9d8451d | ||
|
|
2d088ea80a | ||
|
|
f0b0cc7cae |
12 changed files with 52 additions and 48 deletions
|
|
@ -6,6 +6,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
name = "github-theme";
|
||||
package = "github-nvim-theme";
|
||||
isColorscheme = true;
|
||||
colorscheme = "github_dark";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
|
|
|
|||
|
|
@ -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
12
flake.lock
generated
|
|
@ -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
24
flake/dev/flake.lock
generated
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue