From 89df33f882473f714162ead43288455d6192a35a Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 8 May 2021 21:05:39 +0200 Subject: 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). --- nixos/modules/services/networking/hylafax/systemd.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nixos/modules/services/networking/hylafax') diff --git a/nixos/modules/services/networking/hylafax/systemd.nix b/nixos/modules/services/networking/hylafax/systemd.nix index f63f7c97ad1..137698ef83d 100644 --- a/nixos/modules/services/networking/hylafax/systemd.nix +++ b/nixos/modules/services/networking/hylafax/systemd.nix @@ -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 -- cgit 1.4.1