From 8712e1dafc8127f912ce06836bd1deb7dab6730d Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 12 Jul 2012 13:46:04 -0400 Subject: [PATCH] Add lib module for modules to provide helper functions --- 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 000000000000..18fc68a69883 --- /dev/null +++ b/modules/misc/lib.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +{ + options = { + lib = pkgs.lib.mkOption { + default = {}; + + type = pkgs.lib.types.attrsOf pkgs.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 0a6507cd5e6d..dfc91a765bef 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -34,6 +34,7 @@ ./misc/crashdump.nix ./misc/ids.nix ./misc/locate.nix + ./misc/lib.nix ./misc/nixpkgs.nix ./misc/passthru.nix ./misc/version.nix