diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-23 17:50:55 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-23 20:08:21 +0200 |
commit | 0ec10c57df93f38b69df73ec1bb91457e657cb7b (patch) | |
tree | 34d3b752148ee2bef7f9583be9565b3e0eb93729 /nixos/modules | |
parent | ec0911ce7f4aabed0b7fc5a8697e004ef16cbd71 (diff) | |
download | nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.tar nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.tar.gz nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.tar.bz2 nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.tar.lz nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.tar.xz nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.tar.zst nixlib-0ec10c57df93f38b69df73ec1bb91457e657cb7b.zip |
Fix style
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/rename.nix | 38 |
1 files 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 <option>${to}</option>."; - 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 <option>${to}</option>."; + 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 ([] |