summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/modules.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index e2315290ff0d..2b1faf4f0c28 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -764,12 +764,15 @@ rec {
fromOpt = getAttrFromPath from options;
toOf = attrByPath to
(abort "Renaming error: option `${showOption to}' does not exist.");
+ toType = let opt = attrByPath to {} options; in opt.type or null;
in
{
options = setAttrByPath from (mkOption {
inherit visible;
description = "Alias of <option>${showOption to}</option>.";
apply = x: use (toOf config);
+ } // optionalAttrs (toType != null) {
+ type = toType;
});
config = mkMerge [
{