Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
32 lines
853 B
Nix
32 lines
853 B
Nix
{ config, lib, ... }:
|
|
|
|
{
|
|
options = {
|
|
result = lib.mkOption { };
|
|
weird = lib.mkOption {
|
|
type = lib.types.submoduleWith {
|
|
# I generally recommend against overriding lib, because that leads to
|
|
# slightly incompatible dialects of the module system.
|
|
# Nonetheless, it's worth guarding the property that the module system
|
|
# evaluates with a completely custom lib, as a matter of separation of
|
|
# concerns.
|
|
specialArgs.lib = { };
|
|
modules = [ ];
|
|
};
|
|
};
|
|
};
|
|
config.weird =
|
|
args@{
|
|
... # note the lack of a `lib` argument
|
|
}:
|
|
assert args.lib == { };
|
|
assert args.specialArgs == { lib = { }; };
|
|
{
|
|
options.foo = lib.mkOption { };
|
|
config.foo = lib.mkIf true "alright";
|
|
};
|
|
config.result =
|
|
assert config.weird.foo == "alright";
|
|
"ok";
|
|
}
|