From 790cd012d0a955ec6bbfd5d0a8b247523ed8810a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 30 Dec 2019 00:49:44 +0100 Subject: [PATCH] nixos/lib: Inherit type for doRename options Co-authored-by: Silvan Mosberger --- lib/modules.nix | 3 +++ 1 file changed, 3 insertions(+) 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 ."; apply = x: use (toOf config); + } // optionalAttrs (toType != null) { + type = toType; }); config = mkMerge [ {