core/lib/tests/modules/functionTo/trivial.nix

17 lines
278 B
Nix
Raw Normal View History

2024-05-01 22:14:04 +00:00
{ lib, config, ... }:
let
inherit (lib) types;
2024-06-30 08:12:46 +00:00
in
{
2024-05-01 22:14:04 +00:00
options = {
2024-06-30 08:12:46 +00:00
fun = lib.mkOption { type = types.functionTo types.str; };
2024-05-01 22:14:04 +00:00
result = lib.mkOption {
type = types.str;
default = config.fun "input";
};
};
config.fun = input: "input is ${input}";
}