diff options
| author | Chris Montgomery <chris@alley.co> | 2022-01-23 12:42:09 -0500 |
|---|---|---|
| committer | Chris Montgomery <chris@alley.co> | 2022-01-23 12:42:09 -0500 |
| commit | 9c645f5c61ce9401ea0402feccc15a70443df5ad (patch) | |
| tree | 49929bd153629d585994e82cf960fa5f58cbdaa5 /modules | |
| parent | bcdb6022b3a300abf59cb5d0106c158940f5120e (diff) | |
feat: add top-level `lib` option
For parity with NixOS:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/lib.nix
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/misc/lib.nix | 15 | ||||
| -rw-r--r-- | modules/module-list.nix | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/misc/lib.nix b/modules/misc/lib.nix new file mode 100644 index 0000000..e50794c --- /dev/null +++ b/modules/misc/lib.nix @@ -0,0 +1,15 @@ +{ lib, ... }: + +{ + options = { + lib = lib.mkOption { + default = { }; + + type = lib.types.attrsOf lib.types.attrs; + + description = '' + This option allows modules to define helper functions, constants, etc. + ''; + }; + }; +} diff --git a/modules/module-list.nix b/modules/module-list.nix index 30a83b9..03c770e 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -1,6 +1,7 @@ [ ./alias.nix ./documentation + ./misc/lib.nix ./security/pki ./security/sandbox ./system |
