From ae0df5d38afdb0be90973ddd42b1c9b1059464fd Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Fri, 20 May 2022 22:28:38 +0100 Subject: [PATCH] lib.sourceTypes: simplify implementation Co-authored-by: Alexander Foremny --- lib/source-types.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/source-types.nix b/lib/source-types.nix index 8a4ab540b9da..c4f263dcf464 100644 --- a/lib/source-types.nix +++ b/lib/source-types.nix @@ -1,17 +1,11 @@ { lib }: -lib.mapAttrs (tname: tset: let - defaultSourceType = { +let + defaultSourceType = tname: { shortName = tname; isSource = false; }; - - mkSourceType = sourceTypeDeclaration: let - applyDefaults = sourceType: defaultSourceType // sourceType; - in lib.pipe sourceTypeDeclaration [ - applyDefaults - ]; -in mkSourceType tset) { +in lib.mapAttrs (tname: tset: defaultSourceType tname // tset) { fromSource = { isSource = true;