mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-13 11:15:37 +01:00
35 lines
642 B
Nix
35 lines
642 B
Nix
{ lib, ... }:
|
|
let
|
|
inherit (lib) types mkOption;
|
|
in
|
|
{
|
|
options.either = mkOption {
|
|
type = types.submodule {
|
|
freeformType = (types.either types.int types.int);
|
|
};
|
|
};
|
|
|
|
options.eitherBehindNullor = mkOption {
|
|
type = types.submodule {
|
|
freeformType = types.nullOr (types.either types.int types.int);
|
|
};
|
|
};
|
|
|
|
options.oneOf = mkOption {
|
|
type = types.submodule {
|
|
freeformType = (
|
|
types.oneOf [
|
|
types.int
|
|
types.int
|
|
]
|
|
);
|
|
};
|
|
};
|
|
|
|
options.number = mkOption {
|
|
type = types.submodule {
|
|
freeformType = (types.number); # either int float
|
|
};
|
|
};
|
|
}
|