mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-19 02:44:17 +03:00
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
Block a user