From 0ec10c57df93f38b69df73ec1bb91457e657cb7b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 23 Oct 2013 17:50:55 +0200 Subject: [PATCH] Fix style --- nixos/modules/rename.nix | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 7ddca7a52128..3e3f6dd10c10 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -1,4 +1,6 @@ -{pkgs, options, config, ...}: +{ config, pkgs, options, ... }: + +with pkgs.lib; let @@ -24,8 +26,7 @@ let abort "Deprecated option `${from}' is defined instead of `${to}'."; }; - - zipModules = list: with pkgs.lib; + zipModules = list: zipAttrsWith (n: v: if tail v != [] then if n == "_type" then (head v) @@ -36,7 +37,7 @@ let else head v ) list; - rename = statusTemplate: from: to: with pkgs.lib; + rename = statusTemplate: from: to: let status = statusTemplate from to; setTo = setAttrByPath (splitString "." to); @@ -46,21 +47,20 @@ let fromOf = attrByPath (splitString "." from) (abort "Internal error: option `${from}' should be declared."); in - [{ - options = setFrom (mkOption { - description = "${status.name} of ."; - apply = x: status.msg.use (toOf config); - visible = false; - }); - }] ++ - [{ - options = setTo (mkOption { - extraConfigs = - let externalDefs = (fromOf options).definitions; in - if externalDefs == [] then [] - else map (def: def.value) (status.msg.define externalDefs); - }); - }]; + [ { options = setFrom (mkOption { + description = "${status.name} of ."; + apply = x: status.msg.use (toOf config); + visible = false; + }); + } + { options = setTo (mkOption { + extraConfigs = + let externalDefs = (fromOf options).definitions; in + if externalDefs == [] then [] + else map (def: def.value) (status.msg.define externalDefs); + }); + } + ]; in zipModules ([]