lib.sourceTypes: simplify implementation

Co-authored-by: Alexander Foremny <aforemny@posteo.de>
This commit is contained in:
Robert Scott 2022-05-20 22:28:38 +01:00 committed by Alexander Foremny
parent 5bb9bf4774
commit ae0df5d38a

View File

@ -1,17 +1,11 @@
{ lib }: { lib }:
lib.mapAttrs (tname: tset: let let
defaultSourceType = { defaultSourceType = tname: {
shortName = tname; shortName = tname;
isSource = false; isSource = false;
}; };
in lib.mapAttrs (tname: tset: defaultSourceType tname // tset) {
mkSourceType = sourceTypeDeclaration: let
applyDefaults = sourceType: defaultSourceType // sourceType;
in lib.pipe sourceTypeDeclaration [
applyDefaults
];
in mkSourceType tset) {
fromSource = { fromSource = {
isSource = true; isSource = true;