File tree Expand file tree Collapse file tree 6 files changed +21
-9
lines changed
Expand file tree Collapse file tree 6 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 1010 name :
1111 let
1212 module = module_set . ${ name } ;
13- list = ( self . lib . evalModule module ) . config . meta . maintainers ;
13+ list = ( self . lib . evalModule module ) . options . meta . maintainers . definitionsWithLocations ;
1414 check = modpath : pkgs . lib . findFirst ( v : toString v . file == toString modpath ) null list == null ;
1515 in
1616 if ! pkgs . lib . isStringLike module then false else check module
Original file line number Diff line number Diff line change 5252 options ,
5353 transform ? null ,
5454 includeCore ? true ,
55+ prefix ? false ,
5556 ...
5657 } :
5758 lib . pipe
6061 options
6162 includeCore
6263 transform
64+ prefix
6365 ;
6466 }
6567 [
Original file line number Diff line number Diff line change 55} :
66{
77 options ,
8- prefix ? null ,
8+ prefix ? false ,
99 transform ? null ,
1010 includeCore ? true ,
1111 ...
1515 options . extendModules . value or (
1616 _ : throw "nix-wrapper-modules docgen error: the options set passed was not from a wrapper module!"
1717 )
18- { ${ if prefix != null then "prefix" else null } = prefix ; } ;
18+ { ${ if prefix == null || builtins . isList prefix then "prefix" else null } = prefix ; } ;
1919in
2020let
2121 inherit ( evaluated ) options graph ;
Original file line number Diff line number Diff line change 1010 options ,
1111 includeCore ? true ,
1212 transform ? null ,
13+ prefix ? false ,
1314 nameFromModule ?
1415 { file , ... } :
1516 lib . removeSuffix "/module.nix" ( lib . removePrefix "${ wlib . modulesPath } /" ( toString file ) ) ,
4950 inherit
5051 options
5152 transform
53+ prefix
5254 includeCore
5355 ;
5456 } ) ;
Original file line number Diff line number Diff line change 197197 options = lib . setAttrByPath ( optloc ++ [ name ] ) (
198198 lib . mkOption {
199199 default = { } ;
200+ description = ''
201+ wrapper module for `${ name } ` as a submodule option
202+ '' ;
200203 type = wlib . types . subWrapperModule (
201204 ( lib . toList value )
202205 ++ [
Original file line number Diff line number Diff line change 11let
22 options_module =
3- excluded : is_top :
3+ _file : excluded : is_top :
44 {
55 config ,
66 options ,
1111 ...
1212 } :
1313 {
14- _file = ./module.nix ;
14+ inherit _file ;
1515 options . ${ if ! ( excluded . argv0type or false ) then "argv0type" else null } = lib . mkOption {
1616 type =
1717 with lib . types ;
@@ -470,10 +470,11 @@ let
470470 inherit wlib ;
471471 } ;
472472 modules = [
473- ( options_module excluded false )
473+ ( options_module _file excluded false )
474474 (
475475 { name , ... } :
476476 {
477+ inherit _file ;
477478 options . enable = lib . mkOption {
478479 type = lib . types . bool ;
479480 default = true ;
573574 excluded_options = { } ;
574575 exclude_wrapper = false ;
575576 exclude_meta = false ;
577+ _file = ./module.nix ;
578+ key = ./module.nix ;
576579 __functor =
577580 self :
578581 {
581584 ...
582585 } :
583586 {
584- _file = ./module.nix ;
585- key = ./module.nix ;
586- imports = [ ( options_module ( self . excluded_options or { } ) true ) ] ;
587+ _file = self . _file or ./module.nix ;
588+ ${ if ( self . key or ./module.nix ) != null then "key" else null } = self . key or ./module.nix ;
589+ imports = [ ( options_module ( self . _file or ./module.nix ) ( self . excluded_options or { } ) true ) ] ;
587590 config . ${ if self . exclude_wrapper or false then null else "wrapperFunction" } = lib . mkDefault (
588591 self . wrapperFunction or ( import ./. null )
589592 ) ;
648651 `excluded_options = { ... };` where you may include `optionname = true`
649652 in order to not define that option.
650653
654+ `_file` and `key`: `_file` changes the value set for the modules imported when you import this module. `key` is set on the main one if not `null`.
655+
651656 In order to change these values, you change them in the set before importing the module like so:
652657
653658 ```nix
You can’t perform that action at this time.
0 commit comments