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,
# makes sure "Include" is listed *first*
let
mkLines = conf:
(lib.concatLists
(lib.flip lib.mapAttrsToList conf
(k: map (v: "${k}: ${v}")
)));
mkLines = lib.flip lib.pipe [
(lib.mapAttrsToList (key: map (val: "${key}: ${val}")))
lib.concatLists
];
include = mkLines { Include = conf.Include or []; };
other = mkLines ( conf // { Include = []; } );
in