parent
eec83d41e3
commit
cc81320a46
@ -0,0 +1,30 @@ |
||||
{ lib, ... }: { |
||||
options.submodule = lib.mkOption { |
||||
type = lib.types.submoduleWith { |
||||
modules = [ |
||||
{ |
||||
options.inner = lib.mkOption { |
||||
type = lib.types.bool; |
||||
default = false; |
||||
}; |
||||
} |
||||
{ |
||||
outer = true; |
||||
} |
||||
]; |
||||
}; |
||||
default = {}; |
||||
}; |
||||
|
||||
config.submodule = lib.mkMerge [ |
||||
({ lib, ... }: { |
||||
options.outer = lib.mkOption { |
||||
type = lib.types.bool; |
||||
default = false; |
||||
}; |
||||
}) |
||||
{ |
||||
inner = true; |
||||
} |
||||
]; |
||||
} |
@ -0,0 +1,13 @@ |
||||
{ lib, ... }: let |
||||
sub.options.config = lib.mkOption { |
||||
type = lib.types.bool; |
||||
default = false; |
||||
}; |
||||
in { |
||||
options.submodule = lib.mkOption { |
||||
type = lib.types.submoduleWith { |
||||
modules = [ sub ]; |
||||
}; |
||||
default = {}; |
||||
}; |
||||
} |
@ -0,0 +1,12 @@ |
||||
{ lib, ... }: { |
||||
options.submodule = lib.mkOption { |
||||
type = lib.types.submoduleWith { |
||||
modules = [ |
||||
./declare-enable.nix |
||||
]; |
||||
}; |
||||
default = {}; |
||||
}; |
||||
|
||||
config.submodule = ./define-enable.nix; |
||||
} |
@ -0,0 +1,14 @@ |
||||
{ lib, ... }: let |
||||
sub.options.config = lib.mkOption { |
||||
type = lib.types.bool; |
||||
default = false; |
||||
}; |
||||
in { |
||||
options.submodule = lib.mkOption { |
||||
type = lib.types.submoduleWith { |
||||
modules = [ sub ]; |
||||
shorthandOnlyDefinesConfig = true; |
||||
}; |
||||
default = {}; |
||||
}; |
||||
} |
@ -0,0 +1,17 @@ |
||||
{ lib, ... }: { |
||||
options.submodule = lib.mkOption { |
||||
type = lib.types.submoduleWith { |
||||
modules = [ |
||||
({ lib, ... }: { |
||||
options.foo = lib.mkOption { |
||||
default = lib.foo; |
||||
}; |
||||
}) |
||||
]; |
||||
specialArgs.lib = lib // { |
||||
foo = "foo"; |
||||
}; |
||||
}; |
||||
default = {}; |
||||
}; |
||||
} |
@ -0,0 +1,3 @@ |
||||
{ |
||||
submodule.config.config = true; |
||||
} |
@ -0,0 +1,3 @@ |
||||
{ |
||||
submodule.config = true; |
||||
} |
Loading…
Reference in new issue