Skip to content

Instantly share code, notes, and snippets.

@danbst
Created March 15, 2019 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbst/c925b77ef7cc349c632dc9edd7659771 to your computer and use it in GitHub Desktop.
Save danbst/c925b77ef7cc349c632dc9edd7659771 to your computer and use it in GitHub Desktop.
let
sub = { config, lib, parentConfig, ...}: {
options.foo = lib.mkOption {
type = lib.types.bool;
default = parentConfig.bar;
};
};
in { config, lib, ...}: {
options.bar = lib.mkOption { type = lib.types.bool; default = true; };
options.bla = lib.mkOption {
type = with lib.types; attrsOf (submodule { imports = [sub]; _module.args.parentConfig = config; });
};
config.bla.test = {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment