nixos/lib: Inherit type for doRename options (#78135)
nixos/lib: Inherit type for doRename options
This commit is contained in:
commit
774e3d8e48
@ -764,12 +764,15 @@ rec {
|
|||||||
fromOpt = getAttrFromPath from options;
|
fromOpt = getAttrFromPath from options;
|
||||||
toOf = attrByPath to
|
toOf = attrByPath to
|
||||||
(abort "Renaming error: option `${showOption to}' does not exist.");
|
(abort "Renaming error: option `${showOption to}' does not exist.");
|
||||||
|
toType = let opt = attrByPath to {} options; in opt.type or null;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = setAttrByPath from (mkOption {
|
options = setAttrByPath from (mkOption {
|
||||||
inherit visible;
|
inherit visible;
|
||||||
description = "Alias of <option>${showOption to}</option>.";
|
description = "Alias of <option>${showOption to}</option>.";
|
||||||
apply = x: use (toOf config);
|
apply = x: use (toOf config);
|
||||||
|
} // optionalAttrs (toType != null) {
|
||||||
|
type = toType;
|
||||||
});
|
});
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user