From 790cd012d0a955ec6bbfd5d0a8b247523ed8810a Mon Sep 17 00:00:00 2001 From: Janne Heß Date: Mon, 30 Dec 2019 00:49:44 +0100 Subject: nixos/lib: Inherit type for doRename options Co-authored-by: Silvan Mosberger --- lib/modules.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/modules.nix') diff --git a/lib/modules.nix b/lib/modules.nix index e2315290ff0..2b1faf4f0c2 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 [ { -- cgit 1.4.1