From f8ab5fcd8d15dd551dfc5c6e34f27a1e92d7b1f6 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 20 Oct 2020 16:10:21 +0200 Subject: [PATCH] lib/modules: Simplify inherits --- lib/modules.nix | 72 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/lib/modules.nix b/lib/modules.nix index 37e2e23ec12..6c4a8f7b324 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -1,14 +1,43 @@ { lib }: let - inherit (lib.attrsets) + inherit (lib) + all + any + attrByPath + attrNames + catAttrs + concatLists + concatMap + count + elem + filter + findFirst + flip + foldl + foldl' + getAttrFromPath + head + id + imap1 + isAttrs + isBool + isFunction + isString + length + mapAttrs + mapAttrsToList mapAttrsRecursiveCond - ; - inherit (lib.lists) - any all concatLists concatMap - count filter findFirst foldl foldl' - head imap1 length optional + min + optional + optionalAttrs + optionalString + recursiveUpdate reverseList sort + setAttrByPath + toList + types + warn ; inherit (lib.options) isOption @@ -18,37 +47,6 @@ let showOption unknownModule ; - inherit (lib.attrsets) - attrByPath - attrNames - catAttrs - getAttrFromPath - mapAttrs - mapAttrsToList - optionalAttrs - recursiveUpdate - setAttrByPath - toList - ; - inherit (lib.types) - types - ; - inherit (lib.trivial) - flip - id - isBool - isFunction - isString - min - warn - ; - inherit (lib.strings) - optionalString - ; - inherit (lib) - elem - isAttrs - ; in rec {