diff options
author | Silvan Mosberger <contact@infinisil.com> | 2021-01-21 21:57:48 +0100 |
---|---|---|
committer | Silvan Mosberger <contact@infinisil.com> | 2021-01-21 21:57:48 +0100 |
commit | 7f2fcc45f734c1e73cef2d7063562b9e411c2614 (patch) | |
tree | 9d7116b88eed8fea38d109627abd44994c9fbae6 | |
parent | 33fc9b1c6dec3287425ad88e60e6534e33d1f9b9 (diff) |
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.
-rw-r--r-- | lib/modules.nix | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |