3
0
Fork 0
forked from mirrors/nixpkgs

nixos/rename: Fix merging multiple destinations.

The renaming of options define the original value for the new attribute
path. This works well if there is only *one* target, but if there are
more, we end up recursing into the attribute set of the option
definition itself.

We now check for that within the parent recursion node (we can't check
that from the subnode, because we lack that information about whether
it's defined multiple times) and if the subnode consist entirely of a
list of definitions, we use mkMerge on it.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-01-22 14:02:47 +01:00
parent c5692758b5
commit 127c928c23
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
2 changed files with 4 additions and 11 deletions

View file

@ -33,7 +33,8 @@ let
zipModules = list:
zipAttrsWith (n: v:
if tail v != [] then
if n == "_type" then (head v)
if all (o: isAttrs o && o ? _type) v then mkMerge v
else if n == "_type" then head v
else if n == "warnings" then concatLists v
else if n == "description" || n == "apply" then
abort "Cannot rename an option to multiple options."
@ -115,8 +116,8 @@ in zipModules ([]
++ obsolete [ "nix" "proxy" ] [ "networking" "proxy" "default" ]
# KDE
++ deprecated [ "kde" "extraPackages" ] [ "environment" "kdePackages" ]
# ++ obsolete [ "environment" "kdePackages" ] [ "environment" "systemPackages" ] # !!! doesn't work!
++ deprecated [ "kde" "extraPackages" ] [ "environment" "systemPackages" ]
++ obsolete [ "environment" "kdePackages" ] [ "environment" "systemPackages" ]
# Multiple efi bootloaders now
++ obsolete [ "boot" "loader" "efi" "efibootmgr" "enable" ] [ "boot" "loader" "efi" "canTouchEfiVariables" ]

View file

@ -70,14 +70,6 @@ in
description = "Custom kde-workspace, used for NixOS rebranding.";
};
};
environment.kdePackages = mkOption {
default = [];
example = literalExample "[ pkgs.kde4.kdesdk ]";
type = types.listOf types.package;
description = "This option is obsolete. Please use <option>environment.systemPackages</option> instead.";
};
};