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:
parent
449647daf5
commit
89df33f882
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue