-
-
Save betaboon/1c09d90f911f59f5ebea7df8960dff97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, ... }: with lib; let | |
mySubmoduleOptions = { name, config, ... }: { | |
options = { | |
myOption = mkOption { | |
default = true; | |
type = types.bool; | |
}; | |
}; | |
}; | |
in { | |
options = { | |
mymodule.defaults = mkOption { | |
default = {}; | |
type = types.submodule mySubmoduleOptions; | |
}; | |
mymodule.services = mkOption { | |
default = {}; | |
type = with types; attrsOf (submodule { | |
options = { | |
custom = mkOption { | |
default = {}; | |
type = types.submodule (recursiveUpdate | |
(mySubmoduleOptions {}) | |
(with config.mymodule.defaults; { | |
options.myOption.default = myOption; | |
})); | |
}; | |
}; | |
}); | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment