From 9c645f5c61ce9401ea0402feccc15a70443df5ad Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Sun, 23 Jan 2022 12:42:09 -0500 Subject: [PATCH] feat: add top-level `lib` option For parity with NixOS: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/lib.nix --- modules/misc/lib.nix | 15 +++++++++++++++ modules/module-list.nix | 1 + 2 files changed, 16 insertions(+) create mode 100644 modules/misc/lib.nix diff --git a/modules/misc/lib.nix b/modules/misc/lib.nix new file mode 100644 index 00000000..e50794cc --- /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 30a83b9b..03c770e8 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