nixos/hylafax: replace a nested expression with lib.pipe

This avoids a tripple-nested function call,
and it looks slightly simpler (at least to me).
This commit is contained in:
Yarny0 2021-05-08 21:05:39 +02:00
parent 449647daf5
commit 89df33f882

View file

@ -13,11 +13,10 @@ let
# creates hylafax config file, # creates hylafax config file,
# makes sure "Include" is listed *first* # makes sure "Include" is listed *first*
let let
mkLines = conf: mkLines = lib.flip lib.pipe [
(lib.concatLists (lib.mapAttrsToList (key: map (val: "${key}: ${val}")))
(lib.flip lib.mapAttrsToList conf lib.concatLists
(k: map (v: "${k}: ${v}") ];
)));
include = mkLines { Include = conf.Include or []; }; include = mkLines { Include = conf.Include or []; };
other = mkLines ( conf // { Include = []; } ); other = mkLines ( conf // { Include = []; } );
in in