git.iko.soy/typeable/nixpkgs
on master help sign in
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).

commit89df33f882473f714162ead43288455d6192a35a authorYarny0 <41838844+Yarny0@users.noreply.github.com> dateSat 8 May 2021, 21:05 (6 years ago) parent449647d
1 file changed+4−5
nixos/modules/services/networking/hylafax/systemd.nix+4−5
nixos/modules/services/networking/hylafax/systemd.nix+4−5
@@ -13,11 +13,10 @@ let
1313 # creates hylafax config file,
1414 # makes sure "Include" is listed *first*
1515 let
16− mkLines = conf:
17− (lib.concatLists
18− (lib.flip lib.mapAttrsToList conf
19− (k: map (v: "${k}: ${v}")
20− )));
16+ mkLines = lib.flip lib.pipe [
17+ (lib.mapAttrsToList (key: map (val: "${key}: ${val}")))
18+ lib.concatLists
19+ ];
2120 include = mkLines { Include = conf.Include or []; };
2221 other = mkLines ( conf // { Include = []; } );
2322 in