diff --git a/ci/version-info/supported-versions.nix b/ci/version-info/supported-versions.nix index 73c7a4d4..6dc4bb74 100644 --- a/ci/version-info/supported-versions.nix +++ b/ci/version-info/supported-versions.nix @@ -19,7 +19,7 @@ let |> builtins.attrValues |> builtins.filter (entry: entry.variant or null == "primary") |> builtins.filter (entry: builtins.elem entry.status supported) - |> builtins.map (entry: { + |> map (entry: { name = entry.channel |> builtins.match "nixos-(.+)" |> builtins.head; value = { inherit (entry) channel status; diff --git a/docs/fix-links/default.nix b/docs/fix-links/default.nix index 4d01c651..91814379 100644 --- a/docs/fix-links/default.nix +++ b/docs/fix-links/default.nix @@ -6,7 +6,7 @@ docsUrl ? "https://nix-community.github.io/nixvim/", }: src: -runCommand (src.name or (builtins.baseNameOf src)) +runCommand (src.name or (baseNameOf src)) { inherit src; bindings = diff --git a/docs/lib/default.nix b/docs/lib/default.nix index 3690b50d..c5fea47f 100644 --- a/docs/lib/default.nix +++ b/docs/lib/default.nix @@ -25,10 +25,10 @@ let builtins.concatMap ( node: let - children = builtins.removeAttrs node [ "_page" ]; + children = removeAttrs node [ "_page" ]; in lib.optional (node ? _page) node._page ++ lib.optionals (children != { }) (collectPages children) - ) (builtins.attrValues (builtins.removeAttrs pages [ "_category" ])); + ) (builtins.attrValues (removeAttrs pages [ "_category" ])); # Normalised page specs pageList = collectPages pages; diff --git a/docs/lib/function-locations.nix b/docs/lib/function-locations.nix index e232d514..d267aa7f 100644 --- a/docs/lib/function-locations.nix +++ b/docs/lib/function-locations.nix @@ -65,7 +65,7 @@ let value = let file = removeNixvimPrefix location.file; - line = builtins.toString location.line; + line = toString location.line; text = "${file}:${line}"; target = "${urlPrefix}/${file}#L${line}"; in @@ -80,6 +80,6 @@ lib.pipe functionSet [ # No need to include out-of-tree entries (builtins.filter (entry: lib.strings.hasPrefix rootPathString entry.location.file)) # Convert entries to attrset - (builtins.map entryToNameValuePair) + (map entryToNameValuePair) builtins.listToAttrs ] diff --git a/docs/mdbook/default.nix b/docs/mdbook/default.nix index 36e748b6..c75cbd01 100644 --- a/docs/mdbook/default.nix +++ b/docs/mdbook/default.nix @@ -37,7 +37,7 @@ let # whether to nest into a sub-page, so that we can keep the original # _freeformOptions attr as intended. attrs._freeformOptions or { } - // builtins.removeAttrs attrs [ + // removeAttrs attrs [ "_module" "_freeformOptions" "warnings" @@ -96,7 +96,7 @@ let let info = lib.attrByPath path { } nixvimInfo; maintainers = lib.unique (configuration.config.meta.maintainers.${info.file} or [ ]); - maintainersNames = builtins.map maintToMD maintainers; + maintainersNames = map maintToMD maintainers; maintToMD = m: if m ? github then "[${m.name}](https://github.com/${m.github})" else m.name; in # Make sure this path has a valid info attrset @@ -304,7 +304,7 @@ let # Attrset of { filePath = renderedDocs; } platformOptionsFiles = lib.listToAttrs ( - builtins.map ( + map ( { path, file, ... }: { name = path; diff --git a/docs/modules/category.nix b/docs/modules/category.nix index 749a29af..218a81a7 100644 --- a/docs/modules/category.nix +++ b/docs/modules/category.nix @@ -12,7 +12,7 @@ let modules = [ ./page.nix ]; }; - pages = builtins.removeAttrs config (builtins.attrNames options); + pages = removeAttrs config (builtins.attrNames options); in { freeformType = lib.types.attrsOf pageType; diff --git a/docs/modules/menu.nix b/docs/modules/menu.nix index eaa90d6b..c7da7236 100644 --- a/docs/modules/menu.nix +++ b/docs/modules/menu.nix @@ -9,7 +9,7 @@ let modules = [ ./category.nix ]; }; - categories = builtins.removeAttrs config (builtins.attrNames options); + categories = removeAttrs config (builtins.attrNames options); in { freeformType = lib.types.attrsOf categoryType; diff --git a/docs/modules/to-menu.nix b/docs/modules/to-menu.nix index f0cab7f7..bed3e86a 100644 --- a/docs/modules/to-menu.nix +++ b/docs/modules/to-menu.nix @@ -20,7 +20,7 @@ let nextPrefix = if showInMenu then loc else prefix; nextIndent = if showInMenu && nested then indent + " " else indent; - children = builtins.removeAttrs page optionNames; + children = removeAttrs page optionNames; submenu = lib.pipe children [ builtins.attrValues (map ( diff --git a/docs/user-configs/tests.nix b/docs/user-configs/tests.nix index 5e62cd3c..d47fcab8 100644 --- a/docs/user-configs/tests.nix +++ b/docs/user-configs/tests.nix @@ -5,7 +5,7 @@ drv, # The derivation under test }: let - toFile = name: v: if lib.isPath v then v else writeText name v; + mkFile = name: v: if lib.isPath v then v else writeText name v; overrideSrc = src: @@ -21,8 +21,8 @@ let }: testers.testEqualContents { assertion = message; - actual = overrideSrc (toFile "${message}-input" input); - expected = toFile "${message}-expected" expected; + actual = overrideSrc (mkFile "${message}-input" input); + expected = mkFile "${message}-expected" expected; }; in # TODO: introduce some negative cases for input that should fail diff --git a/docs/user-guide/faq.md b/docs/user-guide/faq.md index 9b695326..0ae84c65 100644 --- a/docs/user-guide/faq.md +++ b/docs/user-guide/faq.md @@ -103,7 +103,7 @@ You could use the builtin [`map`] function (or similar) to do something like thi ```nix { keymaps = - (builtins.map (key: { + (map (key: { inherit key; action = ""; options.desc = "My cool keymapping"; diff --git a/flake/ci.nix b/flake/ci.nix index 247dea66..1f4bd443 100644 --- a/flake/ci.nix +++ b/flake/ci.nix @@ -1,7 +1,6 @@ { lib, config, ... }: let inherit (lib) - mapAttrs types ; in @@ -39,7 +38,7 @@ in # Transpose per-system definitions to the top-level config.ci = { - buildbot = mapAttrs (_: sysCfg: sysCfg.ci.buildbot) config.allSystems; + buildbot = builtins.mapAttrs (_: sysCfg: sysCfg.ci.buildbot) config.allSystems; }; }; } diff --git a/lib/keymap-helpers.nix b/lib/keymap-helpers.nix index 8f9f2a62..9378a563 100644 --- a/lib/keymap-helpers.nix +++ b/lib/keymap-helpers.nix @@ -65,7 +65,7 @@ rec { # to ensure `lua` isn't evaluated when (e.g.) generating lua code. # Failure to do so will result in "option used but not defined" errors! deprecatedMapOptionSubmodule = mkMapOptionSubmodule { lua = true; }; - removeDeprecatedMapAttrs = v: builtins.removeAttrs v [ "lua" ]; + removeDeprecatedMapAttrs = v: removeAttrs v [ "lua" ]; mkModeOption = default: diff --git a/lib/plugins/utils.nix b/lib/plugins/utils.nix index 87a4b75f..0cf63d58 100644 --- a/lib/plugins/utils.nix +++ b/lib/plugins/utils.nix @@ -138,7 +138,7 @@ }; in lib.pipe depsToEnable [ - (builtins.map enableDepConditionally) + (map enableDepConditionally) lib.listToAttrs ]; }; diff --git a/lib/types.nix b/lib/types.nix index 9a5e637b..125c6151 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -140,7 +140,6 @@ rec { pluginLuaConfig = types.submodule ( { config, ... }: let - inherit (builtins) toString; inherit (lib.nixvim.utils) mkBeforeSection mkAfterSection; in { diff --git a/lib/utils.internal.nix b/lib/utils.internal.nix index 4940e206..813b9fb4 100644 --- a/lib/utils.internal.nix +++ b/lib/utils.internal.nix @@ -138,7 +138,7 @@ rec { message = "${prefix} ${lib.trim a.message}"; }; in - builtins.map processAssertion (lib.toList assertions); + map processAssertion (lib.toList assertions); /** Convert one or several conditional warnings to a final warning list. diff --git a/modules/dependencies.nix b/modules/dependencies.nix index efd7daab..d7602c1e 100644 --- a/modules/dependencies.nix +++ b/modules/dependencies.nix @@ -97,7 +97,7 @@ in extraPackages = lib.pipe cfg [ builtins.attrValues (builtins.filter (p: p.enable)) - (builtins.map (p: p.package)) + (map (p: p.package)) ]; __depPackages = { diff --git a/modules/keymaps.nix b/modules/keymaps.nix index 785f1bfe..ca39a759 100644 --- a/modules/keymaps.nix +++ b/modules/keymaps.nix @@ -70,7 +70,7 @@ in # NOTE: barbar added `mapOptionSubmodule` support shortly _before_ branching off 24.05 (lib.mapAttrsToList (name: opt: opt.valueMeta) ( - builtins.removeAttrs options.plugins.barbar.keymaps [ "silent" ] + removeAttrs options.plugins.barbar.keymaps [ "silent" ] )) ] [ diff --git a/modules/top-level/files/default.nix b/modules/top-level/files/default.nix index ac7e2e7d..1c081a19 100644 --- a/modules/top-level/files/default.nix +++ b/modules/top-level/files/default.nix @@ -20,7 +20,7 @@ let { _module.args = lib.pipe options._module.args [ lib.modules.mergeAttrDefinitionsWithPrio - (lib.flip builtins.removeAttrs [ "name" ]) + (lib.flip removeAttrs [ "name" ]) (lib.mapAttrs (_: { highestPrio, value }: lib.mkOverride highestPrio value)) ]; } diff --git a/modules/top-level/plugins/utils.nix b/modules/top-level/plugins/utils.nix index f85b6e49..dbcf7f7f 100644 --- a/modules/top-level/plugins/utils.nix +++ b/modules/top-level/plugins/utils.nix @@ -29,7 +29,7 @@ lib.fix (self: { defaultPlugin // (if p ? plugin then p else { plugin = p; }); # Normalize a list of plugins - normalizePlugins = builtins.map self.normalizePlugin; + normalizePlugins = map self.normalizePlugin; getAndNormalizeDeps = p: self.normalizePlugins (p.plugin.dependencies or [ ]); diff --git a/modules/top-level/readonly-renames.nix b/modules/top-level/readonly-renames.nix index 0065ee25..e200b4ef 100644 --- a/modules/top-level/readonly-renames.nix +++ b/modules/top-level/readonly-renames.nix @@ -21,9 +21,9 @@ let }; go = - path: name: opt: + optPath: name: opt: let - loc = path ++ lib.singleton name; + loc = optPath ++ lib.singleton name; in if lib.isOption opt then mkAlias loc opt else lib.mapAttrs (go loc) opt; in diff --git a/modules/top-level/test.nix b/modules/top-level/test.nix index abd93cd6..6d8a50b0 100644 --- a/modules/top-level/test.nix +++ b/modules/top-level/test.nix @@ -301,8 +301,8 @@ in name: lib.pipe cfg.${name} [ (builtins.filter (x: !x.predicate input.${name})) - (builtins.map (x: x.message)) - (builtins.map (msg: if lib.isFunction msg then msg input.${name} else msg)) + (map (x: x.message)) + (map (msg: if lib.isFunction msg then msg input.${name} else msg)) ( x: if x == [ ] then diff --git a/plugins/by-name/ccc/default.nix b/plugins/by-name/ccc/default.nix index 80723916..1529af9a 100644 --- a/plugins/by-name/ccc/default.nix +++ b/plugins/by-name/ccc/default.nix @@ -186,7 +186,7 @@ lib.nixvim.plugins.mkNeovimPlugin { (listOf strLua) ) ); - apply = builtins.map mapToRawLua; + apply = map mapToRawLua; default = [ ]; example = [ [ diff --git a/plugins/by-name/efmls-configs/default.nix b/plugins/by-name/efmls-configs/default.nix index 5f94eb22..eee2dc4a 100644 --- a/plugins/by-name/efmls-configs/default.nix +++ b/plugins/by-name/efmls-configs/default.nix @@ -152,7 +152,7 @@ lib.nixvim.plugins.mkNeovimPlugin { ( lib.attrValues ( # Rename aliases added 2025-06-25 in https://github.com/nix-community/nixvim/pull/3503 - builtins.removeAttrs cfg.languages [ + removeAttrs cfg.languages [ "warnings" "HTML" "JSON" @@ -208,7 +208,7 @@ lib.nixvim.plugins.mkNeovimPlugin { (mkToolValue "linters" linter) ++ (mkToolValue "formatters" formatter) ) ( - builtins.removeAttrs cfg.languages [ + removeAttrs cfg.languages [ "all" # Rename aliases added 2025-06-25 in https://github.com/nix-community/nixvim/pull/3503 "warnings" diff --git a/plugins/by-name/friendly-snippets/default.nix b/plugins/by-name/friendly-snippets/default.nix index baf160cf..8fdee054 100644 --- a/plugins/by-name/friendly-snippets/default.nix +++ b/plugins/by-name/friendly-snippets/default.nix @@ -19,9 +19,11 @@ lib.nixvim.plugins.mkVimPlugin { "plugins.blink-cmp.enable" "plugins.nvim-snippets.enable" ]; - enabledConsumers = builtins.filter (path: lib.getAttrFromPath path config) snippetConsumers; + enabledConsumers = builtins.filter ( + consumerPath: lib.getAttrFromPath consumerPath config + ) snippetConsumers; enabledConsumersPretty = lib.concatMapStringsSep ", " ( - path: lib.getAttrFromPath path options + consumerPath: lib.getAttrFromPath consumerPath options ) enabledConsumers; in { diff --git a/plugins/by-name/pckr/default.nix b/plugins/by-name/pckr/default.nix index 69ca52a8..eb59cb91 100644 --- a/plugins/by-name/pckr/default.nix +++ b/plugins/by-name/pckr/default.nix @@ -86,7 +86,7 @@ lib.nixvim.plugins.mkNeovimPlugin { if builtins.isString p then p else - builtins.removeAttrs p [ + removeAttrs p [ "path" "requires" ] diff --git a/plugins/by-name/rainbow-delimiters/default.nix b/plugins/by-name/rainbow-delimiters/default.nix index 2809c9ba..29da683a 100644 --- a/plugins/by-name/rainbow-delimiters/default.nix +++ b/plugins/by-name/rainbow-delimiters/default.nix @@ -6,7 +6,6 @@ }: let opts = options.plugins.rainbow-delimiters; - inherit (builtins) any isNull; inherit (lib) mapAttrs' nameValuePair isString; inherit (lib.nixvim) mkRaw toLuaObject nestedLiteralLua; in @@ -103,7 +102,7 @@ lib.nixvim.plugins.mkNeovimPlugin { ]; assertions = lib.nixvim.mkAssertions "plugins.rainbow-delimiters" { - assertion = any isNull [ + assertion = builtins.any isNull [ (cfg.settings.whitelist or null) (cfg.settings.blacklist or null) ]; diff --git a/plugins/by-name/typescript-tools/default.nix b/plugins/by-name/typescript-tools/default.nix index 035d1813..749a82ca 100644 --- a/plugins/by-name/typescript-tools/default.nix +++ b/plugins/by-name/typescript-tools/default.nix @@ -223,7 +223,7 @@ lib.nixvim.plugins.mkNeovimPlugin { renamedSettings = lib.foldl' ( acc: optPath: let - snakeCasePath = builtins.map lib.nixvim.toSnakeCase optPath; + snakeCasePath = map lib.nixvim.toSnakeCase optPath; optValue = lib.getAttrFromPath optPath cfg.settings; in lib.recursiveUpdate acc (lib.setAttrByPath snakeCasePath optValue) diff --git a/plugins/cmp/sources/_mk-cmp-plugin.nix b/plugins/cmp/sources/_mk-cmp-plugin.nix index cad16699..d8c89b1b 100644 --- a/plugins/cmp/sources/_mk-cmp-plugin.nix +++ b/plugins/cmp/sources/_mk-cmp-plugin.nix @@ -15,7 +15,7 @@ ... }@args: lib.nixvim.plugins.mkVimPlugin ( - builtins.removeAttrs args [ + removeAttrs args [ "pluginName" "sourceName" ] diff --git a/plugins/cmp/sources/default.nix b/plugins/cmp/sources/default.nix index 67a5fe3f..56152e89 100644 --- a/plugins/cmp/sources/default.nix +++ b/plugins/cmp/sources/default.nix @@ -174,7 +174,7 @@ let mkCmpSourcePlugin = import ./_mk-cmp-plugin.nix { inherit lib pkgs; }; - pluginModules = builtins.map mkCmpSourcePlugin sources; + pluginModules = map mkCmpSourcePlugin sources; in { # For extra cmp plugins diff --git a/plugins/deprecation.nix b/plugins/deprecation.nix index fa8cf3a7..b23a7fa7 100644 --- a/plugins/deprecation.nix +++ b/plugins/deprecation.nix @@ -82,7 +82,7 @@ in acc: scope: renamed': acc ++ lib.mapAttrsToList (old: new: lib.mkRenamedOptionModule [ scope old ] [ scope new ]) renamed' ) [ ] renamed - ++ builtins.map ( + ++ map ( name: lib.mkRemovedOptionModule [ "plugins" name "iconsPackage" ] '' Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons`, or `plugins.mini-icons` with `plugins.mini-icons.mockDevIcons` instead. diff --git a/plugins/lsp/default.nix b/plugins/lsp/default.nix index 2130c17b..67608d28 100644 --- a/plugins/lsp/default.nix +++ b/plugins/lsp/default.nix @@ -163,7 +163,7 @@ lib.nixvim.plugins.mkNeovimPlugin { actionStr = action.action or action; mode = action.mode or "n"; actionProps = lib.optionalAttrs (builtins.isAttrs action) ( - builtins.removeAttrs action [ + removeAttrs action [ "action" "mode" ] diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix index dde2430a..ed56c5fa 100644 --- a/plugins/pluginmanagers/lazy.nix +++ b/plugins/pluginmanagers/lazy.nix @@ -169,7 +169,7 @@ lib.nixvim.plugins.mkNeovimPlugin { in [ (mkEntryFromDrv plugin) ] ++ processDependencies; - processedPlugins = builtins.concatLists (builtins.map processPlugin cfg.plugins); + processedPlugins = builtins.concatLists (map processPlugin cfg.plugins); lazyPath = pkgs.linkFarm "lazy-plugins" processedPlugins; pluginToLua = diff --git a/tests/fetch-tests.nix b/tests/fetch-tests.nix index b45d116d..7aac5d2f 100644 --- a/tests/fetch-tests.nix +++ b/tests/fetch-tests.nix @@ -27,7 +27,7 @@ let # Recurse into all directories, extracting files as we find them. # This returns a list of { name; file; cases; } attrsets. fetchTests = - path: namespace: + testPath: namespace: let # Handle an entry from readDir # - If it is a regular nix file, import its content @@ -35,7 +35,7 @@ let handleEntry = name: type: let - file = /${path}/${name}; + file = /${testPath}/${name}; in if type == "regular" then lib.optional (lib.hasSuffix ".nix" name) ( @@ -46,7 +46,7 @@ let else fetchTests file (namespace ++ [ name ]); in - lib.pipe path [ + lib.pipe testPath [ builtins.readDir (lib.filterAttrs (n: v: v != "symlink")) (lib.mapAttrsToList handleEntry) diff --git a/tests/generated.nix b/tests/generated.nix index 9ece5d6b..684651a8 100644 --- a/tests/generated.nix +++ b/tests/generated.nix @@ -29,7 +29,7 @@ let let missingFromPkgs = builtins.concatMap ( loc: lib.optional (!lib.hasAttrByPath loc pkgs) (lib.concatStringsSep "." loc) - ) (builtins.map lib.toList packages); + ) (map lib.toList packages); undeclared = lib.filter (name: !(lib.elem name declared)) generated; uselesslyDeclared = lib.partition (name: lib.elem name unsupported) ( lib.filter (name: !(lib.elem name generated)) declared diff --git a/tests/lib-tests.nix b/tests/lib-tests.nix index f2734634..27732228 100644 --- a/tests/lib-tests.nix +++ b/tests/lib-tests.nix @@ -564,7 +564,7 @@ else runCommandLocal "lib-tests-failure" { results = lib.concatStringsSep "\n" ( - builtins.map (result: '' + map (result: '' ${result.name}: expected: ${lib.generators.toPretty { } result.expected} result: ${lib.generators.toPretty { } result.result} diff --git a/tests/main.nix b/tests/main.nix index 648c341d..43403017 100644 --- a/tests/main.nix +++ b/tests/main.nix @@ -45,7 +45,7 @@ let configuration.config.build.test.overrideAttrs (old: { passthru = old.passthru or { } - // builtins.removeAttrs configuration [ + // removeAttrs configuration [ "_type" "type" ] @@ -66,7 +66,7 @@ let config = import ../example.nix { inherit pkgs; }; in { - main = builtins.removeAttrs config.programs.nixvim [ + main = removeAttrs config.programs.nixvim [ # This is not available to standalone modules, only HM & NixOS Modules "enable" # This is purely an example, it does not reflect a real usage diff --git a/tests/maintainers.nix b/tests/maintainers.nix index bb14e323..b9ae6a47 100644 --- a/tests/maintainers.nix +++ b/tests/maintainers.nix @@ -1,14 +1,12 @@ { - lib, nixpkgsLib, runCommandLocal, }: let - inherit (lib) attrNames filter length; nixvimList = import ../lib/maintainers.nix; nixpkgsList = nixpkgsLib.maintainers; - duplicates = filter (name: nixpkgsList ? ${name}) (attrNames nixvimList); - count = length duplicates; + duplicates = builtins.filter (name: nixpkgsList ? ${name}) (builtins.attrNames nixvimList); + count = builtins.length duplicates; in runCommandLocal "maintainers-test" { inherit count duplicates; } '' if [ $count -gt 0 ]; then diff --git a/tests/test-sources/plugins/by-name/efmls-configs/default.nix b/tests/test-sources/plugins/by-name/efmls-configs/default.nix index d15825b8..39494981 100644 --- a/tests/test-sources/plugins/by-name/efmls-configs/default.nix +++ b/tests/test-sources/plugins/by-name/efmls-configs/default.nix @@ -11,7 +11,7 @@ # toolOptions is an attrsets of the form: # { = { linter = tools; formatter = tools; }; } # Where tools is the option type representing the valid tools for this language - toolOptions = builtins.removeAttrs (languages.type.getSubOptions languages.loc) [ + toolOptions = removeAttrs (languages.type.getSubOptions languages.loc) [ "_freeformOptions" "_module" diff --git a/wrappers/_shared.nix b/wrappers/_shared.nix index efae482e..d3e137bd 100644 --- a/wrappers/_shared.nix +++ b/wrappers/_shared.nix @@ -19,8 +19,6 @@ }: let inherit (lib) - listToAttrs - map mkIf mkMerge optionalAttrs @@ -89,7 +87,7 @@ in (optionalAttrs (filesOpt != null) ( mkIf (cfg.enable && !cfg.wrapRc) ( setAttrByPath filesOpt ( - listToAttrs ( + builtins.listToAttrs ( map ( { target, finalSource, ... }: {