summaryrefslogtreecommitdiffstats
path: root/options.nix
diff options
context:
space:
mode:
Diffstat (limited to 'options.nix')
-rw-r--r--options.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/options.nix b/options.nix
new file mode 100644
index 0000000..e01c10d
--- /dev/null
+++ b/options.nix
@@ -0,0 +1,21 @@
+{lib}: {
+ /*
+ Generate an enable option definition, that defaults to true.
+
+ This conveniently allows the composition of a “common” module set.
+
+ # Type
+
+ mkEnable :: String -> AttrSet
+
+ # Arguments
+
+ name
+ : The name to use in the option description.
+ */
+ mkDefaultEnabled = name:
+ (lib.mkEnableOption name)
+ // {
+ default = true;
+ };
+}