From 7f2fcc45f734c1e73cef2d7063562b9e411c2614 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 21 Jan 2021 21:57:48 +0100 Subject: [PATCH] lib/modules: Set submodule type for renamed option sets For renames like mkAliasOptionModule [ "services" "compton" ] [ "services" "picom" ] where the target is an option set (like services.picom) instead of a single option (like services.picom.enable), previously the renamed option type was unset, leading to it being `types.unspecified`. This changes it to be `types.submodule {}` instead, which makes more sense. --- lib/modules.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules.nix b/lib/modules.nix index 3f2bfd478b0d..33a0d84a6d7f 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -895,7 +895,7 @@ 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; + toType = let opt = attrByPath to {} options; in opt.type or (types.submodule {}); in { options = setAttrByPath from (mkOption {