summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2019-12-30 00:49:44 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-01-20 22:06:20 +0100
commit790cd012d0a955ec6bbfd5d0a8b247523ed8810a (patch)
tree8ea8db16496305a6180dd2f63ac5868653a71a3f /lib
parent764aba4c1b7c6461381c0f424fe9ab1951f4c6d3 (diff)
nixos/lib: Inherit type for doRename options
Co-authored-by: Silvan Mosberger <contact@infinisil.com>
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 e2315290ff0d..2b1faf4f0c28 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 [
{