nixos/lib: Inherit type for doRename options

Co-authored-by: Silvan Mosberger <contact@infinisil.com>
wip/yesman
Janne Heß 5 years ago committed by Silvan Mosberger
parent 764aba4c1b
commit 790cd012d0
No known key found for this signature in database
GPG Key ID: E8F1E9EAD284E17D
  1. 3
      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 [
{

Loading…
Cancel
Save