summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-01-20 23:15:24 +0100
committerGitHub <noreply@github.com>2020-01-20 23:15:24 +0100
commit774e3d8e487b4042e8c3f0d18df15519219f6752 (patch)
tree993dd729e673af27eec01107594373a0a949d90b /lib
parent348e48fdccc8efce4c2539922d99d7ecf1542725 (diff)
parent790cd012d0a955ec6bbfd5d0a8b247523ed8810a (diff)
nixos/lib: Inherit type for doRename options (#78135)
nixos/lib: Inherit type for doRename options
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index e2315290ff0dc..2b1faf4f0c28e 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 [
         {