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 30, 2022
1 parent 5bb9bf4 commit ae0df5d
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 ae0df5d

Please sign in to comment.