treewide: format with new nixfmt

This commit is contained in:
Gaetan Lepage 2025-07-25 18:16:52 +02:00 committed by Gaétan Lepage
parent d63fd77511
commit dd73afe9c6
34 changed files with 665 additions and 679 deletions

View file

@ -12,8 +12,7 @@
}; };
# Public `lib` flake output # Public `lib` flake output
flake.lib = flake.lib = {
{
nixvim = lib.makeOverridable (import ../lib) { nixvim = lib.makeOverridable (import ../lib) {
inherit lib; inherit lib;
flake = self; flake = self;

View file

@ -50,7 +50,8 @@ in
modulesPath = ../modules; modulesPath = ../modules;
# TODO: deprecate `helpers` # TODO: deprecate `helpers`
helpers = self; helpers = self;
} // extraSpecialArgs; }
// extraSpecialArgs;
}; };
} }
// lib.mapAttrs ( // lib.mapAttrs (

View file

@ -49,8 +49,7 @@
warnings = warnings =
let let
# All keymap options that have historically supported the `lua` sub-option # All keymap options that have historically supported the `lua` sub-option
keymapOptions = keymapOptions = [
[
options.keymaps options.keymaps
options.keymapsOnEvents options.keymapsOnEvents
options.plugins.wtf.keymaps.ai options.plugins.wtf.keymaps.ai

View file

@ -6,8 +6,9 @@ let
by-name = ../plugins/by-name; by-name = ../plugins/by-name;
in in
{ {
imports = imports = [
[ ../plugins ] ../plugins
]
++ foldlAttrs ( ++ foldlAttrs (
prev: name: type: prev: name: type:
prev ++ optional (type == "directory") (by-name + "/${name}") prev ++ optional (type == "directory") (by-name + "/${name}")

View file

@ -7,8 +7,7 @@ let
]; ];
in in
{ {
imports = imports = [
[
(mkRemovedOptionModule (basePluginPath ++ [ "server" ]) '' (mkRemovedOptionModule (basePluginPath ++ [ "server" ]) ''
To configure the `clangd` language server options, please use To configure the `clangd` language server options, please use
`plugins.lsp.servers.clangd.extraSettings`. `plugins.lsp.servers.clangd.extraSettings`.

View file

@ -6,8 +6,9 @@ lib.nixvim.plugins.mkNeovimPlugin {
maintainers = [ lib.maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
imports = imports = [
[ { cmpSourcePlugins.crates = "crates"; } ] { cmpSourcePlugins.crates = "crates"; }
]
++ ++
# TODO introduced 2024-12-12: remove after 25.05 # TODO introduced 2024-12-12: remove after 25.05
lib.nixvim.mkSettingsRenamedOptionModules [ "plugins" "crates-nvim" ] lib.nixvim.mkSettingsRenamedOptionModules [ "plugins" "crates-nvim" ]

View file

@ -78,8 +78,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
plugins.dap = { plugins.dap = {
enable = true; enable = true;
extensionConfigLua = extensionConfigLua = ''
''
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject cfg.settings}) require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject cfg.settings})
'' ''
+ (optionalString (cfg.testRunners != null) '' + (optionalString (cfg.testRunners != null) ''

View file

@ -34,7 +34,8 @@ rec {
The filetype to use for content retrieved via a source request. The filetype to use for content retrieved via a source request.
''; '';
}; };
} // attrs; }
// attrs;
}; };
executableAdapterOption = mkAdapterType { executableAdapterOption = mkAdapterType {

View file

@ -78,7 +78,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
DapStopped = dapStopped; DapStopped = dapStopped;
DapBreakpointRejected = dapBreakpointRejected; DapBreakpointRejected = dapBreakpointRejected;
}; };
} // cfg.settings; }
// cfg.settings;
in in
{ {
plugins.dap.luaConfig.content = lib.mkMerge [ plugins.dap.luaConfig.content = lib.mkMerge [

View file

@ -190,7 +190,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
action = "Telescope find_files cwd="; action = "Telescope find_files cwd=";
``` ```
''; '';
} // extraOptions; }
// extraOptions;
}; };
in in
{ {

View file

@ -15,8 +15,7 @@ lib.nixvim.plugins.mkVimPlugin {
maintainers = [ lib.maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO: Added 2024-12-16; remove after 25.05 # TODO: Added 2024-12-16; remove after 25.05
optionsRenamedToSettings = optionsRenamedToSettings = [
[
"autoclose" "autoclose"
"autohide" "autohide"
"autoinsert" "autoinsert"
@ -31,7 +30,8 @@ lib.nixvim.plugins.mkVimPlugin {
"width" "width"
"wintype" "wintype"
] ]
++ map ++
map
(name: { (name: {
old = [ old = [
"keymaps" "keymaps"

View file

@ -70,8 +70,7 @@ lib.nixvim.plugins.mkVimPlugin {
]; ];
}; };
settingsOptions = settingsOptions = {
{
preview_win_location = defaultNullOpts.mkEnumFirstDefault [ "bo" "to" "bel" "abo" ] '' preview_win_location = defaultNullOpts.mkEnumFirstDefault [ "bo" "to" "bel" "abo" ] ''
This option determines where the preview window pops up as a result of the This option determines where the preview window pops up as a result of the
`:GitGutterPreviewHunk` command. `:GitGutterPreviewHunk` command.

View file

@ -65,8 +65,7 @@ lib.nixvim.plugins.mkVimPlugin {
}; };
extraOptions = { extraOptions = {
keymaps = keymaps = {
{
silent = mkOption { silent = mkOption {
type = types.bool; type = types.bool;
description = "Whether julia-cell keymaps should be silent"; description = "Whether julia-cell keymaps should be silent";

View file

@ -214,8 +214,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: { extraConfig = cfg: {
autoCmd = lib.optionals (cfg.autoCmd != null) [ cfg.autoCmd ]; autoCmd = lib.optionals (cfg.autoCmd != null) [ cfg.autoCmd ];
plugins.lint.luaConfig.content = plugins.lint.luaConfig.content = ''
''
local __lint = require('lint') local __lint = require('lint')
'' ''
+ (lib.optionalString (cfg.lintersByFt != null) '' + (lib.optionalString (cfg.lintersByFt != null) ''

View file

@ -54,8 +54,7 @@ in
config = config =
let let
doCmp = cfg.cmp.enable && config.plugins.cmp.enable; doCmp = cfg.cmp.enable && config.plugins.cmp.enable;
options = options = {
{
inherit (cfg) mode preset; inherit (cfg) mode preset;
symbol_map = cfg.symbolMap; symbol_map = cfg.symbolMap;
} }

View file

@ -12,8 +12,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
# TODO introduced 2024-02-29: remove 2024-04-29 # TODO introduced 2024-02-29: remove 2024-04-29
deprecateExtraOptions = true; deprecateExtraOptions = true;
imports = imports = [
[
# TODO: added 2025-04-07, remove after 25.05 # TODO: added 2025-04-07, remove after 25.05
(lib.nixvim.mkRemovedPackageOptionModule { (lib.nixvim.mkRemovedPackageOptionModule {
plugin = "neogit"; plugin = "neogit";

View file

@ -14,8 +14,7 @@ let
cfg' = config.plugins.none-ls.sources.${sourceType}.${sourceName}; cfg' = config.plugins.none-ls.sources.${sourceType}.${sourceName};
in in
{ {
options.plugins.none-ls.sources.${sourceType}.${sourceName} = options.plugins.none-ls.sources.${sourceType}.${sourceName} = {
{
enable = lib.mkEnableOption "the ${sourceName} ${sourceType} source for none-ls"; enable = lib.mkEnableOption "the ${sourceName} ${sourceType} source for none-ls";
# Support strLua for compatibility with the old withArgs option # Support strLua for compatibility with the old withArgs option
settings = lib.nixvim.defaultNullOpts.mkStrLuaOr' { settings = lib.nixvim.defaultNullOpts.mkStrLuaOr' {

View file

@ -4,8 +4,7 @@ let
mkSourcePlugin = import ./_mk-source-plugin.nix; mkSourcePlugin = import ./_mk-source-plugin.nix;
in in
{ {
imports = imports = [
[
./prettier.nix ./prettier.nix
./prettierd.nix ./prettierd.nix
] ]

View file

@ -158,7 +158,8 @@ in
extra_opts = extraOpts; extra_opts = extraOpts;
}; };
}; };
} // cfg.extraOptions; }
// cfg.extraOptions;
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ cfg.package ]; extraPlugins = [ cfg.package ];

View file

@ -1186,9 +1186,7 @@ in
nested = true; nested = true;
}); });
extraConfigLua = extraConfigLua = (optionalString autoOpenEnabled openNvimTreeFunction) + ''
(optionalString autoOpenEnabled openNvimTreeFunction)
+ ''
require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions}) require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions})
''; '';

View file

@ -207,7 +207,8 @@ in
reading_text = cfg.readingText; reading_text = cfg.readingText;
workspace_text = cfg.workspaceText; workspace_text = cfg.workspaceText;
line_number_text = cfg.lineNumberText; line_number_text = cfg.lineNumberText;
} // cfg.extraOptions; }
// cfg.extraOptions;
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ cfg.package ]; extraPlugins = [ cfg.package ];

View file

@ -125,7 +125,8 @@ in
standalone file support standalone file support
setting it to false may improve startup time setting it to false may improve startup time
''; '';
} // import ../../lsp/language-servers/rust-analyzer-config.nix lib; }
// import ../../lsp/language-servers/rust-analyzer-config.nix lib;
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
extraPlugins = [ extraPlugins = [
@ -174,7 +175,8 @@ in
inherit (cfg.server) standalone; inherit (cfg.server) standalone;
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server; settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
}; };
} // cfg.extraOptions; }
// cfg.extraOptions;
in in
'' ''
require('rust-tools').setup(${lib.nixvim.toLuaObject options}) require('rust-tools').setup(${lib.nixvim.toLuaObject options})

View file

@ -52,7 +52,8 @@ in
let let
setupOptions = { setupOptions = {
inherit (cfg) skipInsignificantPunctuation; inherit (cfg) skipInsignificantPunctuation;
} // cfg.extraOptions; }
// cfg.extraOptions;
mappings = mapAttrsToList (motion: key: { mappings = mapAttrsToList (motion: key: {
mode = [ mode = [

View file

@ -331,7 +331,8 @@ in
folded_section = foldedSection; folded_section = foldedSection;
}; };
inherit (cfg) parts; inherit (cfg) parts;
} // sections; }
// sections;
in in
'' ''
require('startup').setup(${lib.nixvim.toLuaObject setupOptions}) require('startup').setup(${lib.nixvim.toLuaObject setupOptions})

View file

@ -56,7 +56,8 @@ let
options = settingsOptions; options = settingsOptions;
example = settingsExample; example = settingsExample;
}; };
} // extraOptions; }
// extraOptions;
config = lib.mkIf cfg.enable ( config = lib.mkIf cfg.enable (
lib.mkMerge [ lib.mkMerge [

View file

@ -29,7 +29,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
imports = [ imports = [
# Register nvim-cmp association # Register nvim-cmp association
{ cmpSourcePlugins.codeium = "windsurf-nvim"; } { cmpSourcePlugins.codeium = "windsurf-nvim"; }
] ++ (import ./deprecations.nix { inherit lib; }).imports; ]
++ (import ./deprecations.nix { inherit lib; }).imports;
settingsExample = { settingsExample = {
enable_chat = true; enable_chat = true;

View file

@ -70,8 +70,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
callSetup = false; callSetup = false;
extraConfig = cfg: { extraConfig = cfg: {
plugins.cmp.luaConfig.content = plugins.cmp.luaConfig.content = ''
''
local cmp = require('cmp') local cmp = require('cmp')
cmp.setup(${toLuaObject cfg.settings}) cmp.setup(${toLuaObject cfg.settings})

View file

@ -168,7 +168,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
options = { options = {
inherit (cfg.keymaps) silent; inherit (cfg.keymaps) silent;
desc = "${descPrefix} ${actionStr}"; desc = "${descPrefix} ${actionStr}";
} // actionProps; }
// actionProps;
} }
); );
in in

View file

@ -144,7 +144,8 @@ in
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
description = "Extra options for the ${name} language server."; description = "Extra options for the ${name} language server.";
}; };
} // extraOptions; }
// extraOptions;
}; };
config = lib.mkIf enabled { config = lib.mkIf enabled {
@ -170,7 +171,8 @@ in
opts = opts.settings; opts = opts.settings;
enabled = true; enabled = true;
}; };
} // cfg.extraOptions; }
// cfg.extraOptions;
} }
]; ];
}; };

View file

@ -548,47 +548,35 @@ in
with cfg.pythonPackage.pkgs; with cfg.pythonPackage.pkgs;
{ {
pylsp_mypy = pylsp-mypy.overridePythonAttrs (old: { pylsp_mypy = pylsp-mypy.overridePythonAttrs (old: {
postPatch = postPatch = old.postPatch or '''' + ''
old.postPatch or ''''
+ ''
substituteInPlace setup.cfg \ substituteInPlace setup.cfg \
--replace-fail "python-lsp-server >=1.7.0" "" --replace-fail "python-lsp-server >=1.7.0" ""
''; '';
}); });
isort = pyls-isort.overridePythonAttrs (old: { isort = pyls-isort.overridePythonAttrs (old: {
postPatch = postPatch = old.postPatch or '''' + ''
old.postPatch or ''''
+ ''
substituteInPlace setup.py \ substituteInPlace setup.py \
--replace-fail 'install_requires=["python-lsp-server", "isort"],' 'install_requires=["isort"],' --replace-fail 'install_requires=["python-lsp-server", "isort"],' 'install_requires=["isort"],'
''; '';
}); });
black = python-lsp-black.overridePythonAttrs (old: { black = python-lsp-black.overridePythonAttrs (old: {
postPatch = postPatch = old.postPatch or '''' + ''
old.postPatch or ''''
+ ''
substituteInPlace setup.cfg \ substituteInPlace setup.cfg \
--replace-fail "python-lsp-server>=1.4.0" "" --replace-fail "python-lsp-server>=1.4.0" ""
''; '';
}); });
memestra = pyls-memestra.overridePythonAttrs (old: { memestra = pyls-memestra.overridePythonAttrs (old: {
postPatch = postPatch = old.postPatch or '''' + ''
old.postPatch or ''''
+ ''
sed -i '/python-lsp-server/d' requirements.txt sed -i '/python-lsp-server/d' requirements.txt
''; '';
}); });
rope = pylsp-rope.overridePythonAttrs (old: { rope = pylsp-rope.overridePythonAttrs (old: {
postPatch = postPatch = old.postPatch or '''' + ''
old.postPatch or ''''
+ ''
sed -i '/python-lsp-server/d' setup.cfg sed -i '/python-lsp-server/d' setup.cfg
''; '';
}); });
ruff = python-lsp-ruff.overridePythonAttrs (old: { ruff = python-lsp-ruff.overridePythonAttrs (old: {
postPatch = postPatch = old.postPatch or '''' + ''
old.postPatch or ''''
+ ''
sed -i '/python-lsp-server/d' pyproject.toml sed -i '/python-lsp-server/d' pyproject.toml
''; '';

View file

@ -38,8 +38,7 @@ let
let let
inherit (pkgs.stdenv) hostPlatform; inherit (pkgs.stdenv) hostPlatform;
disabled = disabled = [
[
# DEPRECATED SERVERS # DEPRECATED SERVERS
# See https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig.lua # See https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig.lua
"ruff_lsp" "ruff_lsp"

View file

@ -22,8 +22,7 @@
"_module" "_module"
]; ];
brokenTools = brokenTools = [
[
#TODO Added 2025-04-01 #TODO Added 2025-04-01
# php-cs-fixer is marked as broken # php-cs-fixer is marked as broken
"php_cs_fixer" "php_cs_fixer"
@ -61,8 +60,7 @@
]; ];
# TODO: respect unpackaged from generated # TODO: respect unpackaged from generated
unpackaged = unpackaged = [
[
"blade_formatter" "blade_formatter"
"cljstyle" "cljstyle"
"cspell" "cspell"

View file

@ -105,8 +105,7 @@
sources = sources =
let let
disabled = disabled = [
[
#TODO Added 2025-04-01 #TODO Added 2025-04-01
# php-cs-fixer is marked as broken # php-cs-fixer is marked as broken
"phpcsfixer" "phpcsfixer"

View file

@ -20,8 +20,7 @@
let let
inherit (pkgs.stdenv) hostPlatform; inherit (pkgs.stdenv) hostPlatform;
disabledSources = disabledSources = [
[
# We do not provide the required HF_API_KEY environment variable. # We do not provide the required HF_API_KEY environment variable.
"cmp_ai" "cmp_ai"
# Triggers the warning complaining about treesitter highlighting being disabled # Triggers the warning complaining about treesitter highlighting being disabled