From d4c902319f231f9df4c3746f8ab41cb2ab4a732e 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 8a4ab540b9da19b..c4f263dcf4643c7 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;