diff options
author | Silvan Mosberger <contact@infinisil.com> | 2020-01-20 23:15:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 23:15:24 +0100 |
commit | 774e3d8e487b4042e8c3f0d18df15519219f6752 (patch) | |
tree | 993dd729e673af27eec01107594373a0a949d90b /lib | |
parent | 348e48fdccc8efce4c2539922d99d7ecf1542725 (diff) | |
parent | 790cd012d0a955ec6bbfd5d0a8b247523ed8810a (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.nix | 3 |
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 [ { |