From 40df597205a135a25d13fceed93c2fc18ae9e5f9 Mon Sep 17 00:00:00 2001
From: Nicolas Pierron <nicolas.b.pierron@gmail.com>
Date: Thu, 14 Oct 2010 18:18:38 +0000
Subject: [PATCH] Enables the following renaming A -> C & B -> C and A -> B & B
 -> C.

svn path=/nixos/trunk/; revision=24295
---
 modules/rename.nix | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/rename.nix b/modules/rename.nix
index 2d5a938c628..ebad3821270 100644
--- a/modules/rename.nix
+++ b/modules/rename.nix
@@ -27,7 +27,13 @@ let
 
   zipModules = list: with pkgs.lib;
     zip (n: v:
-      if tail v != [] then zipModules v else head v
+      if tail v != [] then
+        if n == "_type" then builtins.trace "Merge _type" (head v)
+        else if n == "extraConfigs" then builtins.trace "Merge extraConfigs" (concatLists v)
+        else if n == "description" || n == "apply" then
+          abort "Cannot rename an option to multiple options."
+        else zipModules v
+      else head v
     ) list;
 
   rename = statusTemplate: from: to: with pkgs.lib;