lib/types: types.functionTo deprecate functor.wrapped in favor of functor.payload.elemType
This commit is contained in:
parent
4fe25460e1
commit
f6214eb786
@ -77,6 +77,7 @@
|
|||||||
- `lib.types.listOf`
|
- `lib.types.listOf`
|
||||||
- `lib.types.unique` and `lib.types.uniq`
|
- `lib.types.unique` and `lib.types.uniq`
|
||||||
- `lib.types.nullOr`
|
- `lib.types.nullOr`
|
||||||
|
- `lib.types.functionTo`
|
||||||
|
|
||||||
- Plasma 5 and Qt 5 based versions of associated software are deprecated in NixOS 25.05, and will be removed in NixOS 25.11. Users are encouraged to upgrade to Plasma 6.
|
- Plasma 5 and Qt 5 based versions of associated software are deprecated in NixOS 25.05, and will be removed in NixOS 25.11. Users are encouraged to upgrade to Plasma 6.
|
||||||
|
|
||||||
|
|||||||
@ -427,6 +427,12 @@ NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribu
|
|||||||
|
|
||||||
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.nullOr.type.nestedTypes.elemType.functor.wrapped ./deprecated-wrapped.nix
|
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.nullOr.type.nestedTypes.elemType.functor.wrapped ./deprecated-wrapped.nix
|
||||||
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.mergedNullOr.type.nestedTypes.elemType.functor.wrapped ./deprecated-wrapped.nix
|
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.mergedNullOr.type.nestedTypes.elemType.functor.wrapped ./deprecated-wrapped.nix
|
||||||
|
# functionTo
|
||||||
|
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.functionTo.type.functor.wrapped ./deprecated-wrapped.nix
|
||||||
|
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.mergedFunctionTo.type.functor.wrapped ./deprecated-wrapped.nix
|
||||||
|
|
||||||
|
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.functionTo.type.nestedTypes.elemType.functor.wrapped ./deprecated-wrapped.nix
|
||||||
|
NIX_ABORT_ON_WARN=1 checkConfigError 'The deprecated `.*functor.wrapped` attribute .*is accessed, use `.*nestedTypes.elemType` instead.' options.mergedFunctionTo.type.nestedTypes.elemType.functor.wrapped ./deprecated-wrapped.nix
|
||||||
|
|
||||||
# Even with multiple assignments, a type error should be thrown if any of them aren't valid
|
# Even with multiple assignments, a type error should be thrown if any of them aren't valid
|
||||||
checkConfigError 'A definition for option .* is not of type .*' \
|
checkConfigError 'A definition for option .* is not of type .*' \
|
||||||
|
|||||||
@ -8,6 +8,7 @@ let
|
|||||||
listOf
|
listOf
|
||||||
unique
|
unique
|
||||||
nullOr
|
nullOr
|
||||||
|
functionTo
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -42,6 +43,13 @@ in
|
|||||||
options.mergedNullOr = mkOption {
|
options.mergedNullOr = mkOption {
|
||||||
type = nullOr (listOf types.str);
|
type = nullOr (listOf types.str);
|
||||||
};
|
};
|
||||||
|
# nullOr
|
||||||
|
options.functionTo = mkOption {
|
||||||
|
type = functionTo (listOf types.str);
|
||||||
|
};
|
||||||
|
options.mergedFunctionTo = mkOption {
|
||||||
|
type = functionTo (listOf types.str);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
# Module B
|
# Module B
|
||||||
@ -60,6 +68,9 @@ in
|
|||||||
options.mergedNullOr = mkOption {
|
options.mergedNullOr = mkOption {
|
||||||
type = nullOr (listOf types.str);
|
type = nullOr (listOf types.str);
|
||||||
};
|
};
|
||||||
|
options.mergedFunctionTo = mkOption {
|
||||||
|
type = functionTo (listOf types.str);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|||||||
@ -887,7 +887,9 @@ rec {
|
|||||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<function body>" ]);
|
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<function body>" ]);
|
||||||
getSubModules = elemType.getSubModules;
|
getSubModules = elemType.getSubModules;
|
||||||
substSubModules = m: functionTo (elemType.substSubModules m);
|
substSubModules = m: functionTo (elemType.substSubModules m);
|
||||||
functor = (defaultFunctor "functionTo") // { wrapped = elemType; };
|
functor = (elemTypeFunctor "functionTo" { inherit elemType; }) // {
|
||||||
|
type = payload: types.functionTo payload.elemType;
|
||||||
|
};
|
||||||
nestedTypes.elemType = elemType;
|
nestedTypes.elemType = elemType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user