From 6acae46c846b598a6a1721e57572bae0a5f919f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkecan=20Bozdo=C4=9Fan?= Date: Tue, 3 Mar 2026 18:34:09 +0300 Subject: [PATCH] lib: don't inherit unused functions --- lib/attrsets.nix | 5 ++--- lib/customisation.nix | 1 - lib/deprecated/misc.nix | 6 ------ lib/fileset/internal.nix | 8 -------- lib/filesystem.nix | 2 -- lib/modules.nix | 1 - lib/systems/parse.nix | 4 ---- 7 files changed, 2 insertions(+), 25 deletions(-) diff --git a/lib/attrsets.nix b/lib/attrsets.nix index dac850823242..932b66b9cfb6 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -4,9 +4,8 @@ { lib }: let - inherit (builtins) head length typeOf; - inherit (lib.asserts) assertMsg; - inherit (lib.trivial) oldestSupportedReleaseIsAtLeast mergeAttrs; + inherit (builtins) head length; + inherit (lib.trivial) mergeAttrs; inherit (lib.strings) concatStringsSep concatMapStringsSep diff --git a/lib/customisation.nix b/lib/customisation.nix index c44dbb5f9270..dfdb64cbf3e2 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -20,7 +20,6 @@ let take length filterAttrs - optionalString flip head pipe diff --git a/lib/deprecated/misc.nix b/lib/deprecated/misc.nix index 7865f0ce760f..092b3abfd6a0 100644 --- a/lib/deprecated/misc.nix +++ b/lib/deprecated/misc.nix @@ -6,26 +6,20 @@ let any attrByPath attrNames - compare concat - concatMap elem filter foldl foldr - genericClosure head imap1 - init isAttrs isFunction isInt isList - lists listToAttrs mapAttrs mergeAttrs - meta nameValuePair tail toList diff --git a/lib/fileset/internal.nix b/lib/fileset/internal.nix index 08db1a38c1d0..675027c1fee0 100644 --- a/lib/fileset/internal.nix +++ b/lib/fileset/internal.nix @@ -7,7 +7,6 @@ let isAttrs isPath isString - nixVersion pathExists readDir split @@ -21,7 +20,6 @@ let attrValues mapAttrs mapAttrsToList - optionalAttrs zipAttrsWith ; @@ -48,7 +46,6 @@ let append splitRoot hasStorePathPrefix - splitStorePath ; inherit (lib.path.subpath) @@ -62,11 +59,6 @@ let substring stringLength hasSuffix - versionAtLeast - ; - - inherit (lib.trivial) - inPureEvalMode ; in # Rare case of justified usage of rec: diff --git a/lib/filesystem.nix b/lib/filesystem.nix index 39f565329b03..27f3ab1c5ce1 100644 --- a/lib/filesystem.nix +++ b/lib/filesystem.nix @@ -7,14 +7,12 @@ # Tested in lib/tests/filesystem.sh let inherit (builtins) - readDir pathExists toString ; inherit (lib.filesystem) pathIsDirectory - pathIsRegularFile pathType packagesFromDirectoryRecursive ; diff --git a/lib/modules.nix b/lib/modules.nix index bbaa984be0d7..c67ea2247ca7 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -12,7 +12,6 @@ let concatMap concatStringsSep elem - elemAt filter foldl' functionArgs diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 7774c16500d9..cc3be74f86f8 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -47,13 +47,9 @@ let inherit (lib.types) enum - float isType mkOptionType - number setType - string - types ; setTypes =