Skip to content

Commit

Permalink
lib.sourceTypes: simplify implementation
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Foremny <aforemny@posteo.de>
  • Loading branch information
risicle and aforemny committed May 20, 2022
1 parent 97bb4aa commit d4c9023
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/source-types.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit d4c9023

Please sign in to comment.