summaryrefslogtreecommitdiffstats
path: root/options.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-11-02 15:19:44 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-11-02 15:19:44 +0100
commit39a3a1a6f8c0a5bd387dcddf07ea686a3f2e493d (patch)
treeefabda5300b8247f1b7bc2787247a7351e52d100 /options.nix
parentfix(by-name-overlay): Correctly display the `rawPath` in warnings (diff)
downloadnix-library-39a3a1a6f8c0a5bd387dcddf07ea686a3f2e493d.zip
treewide: Add new math and options subcategories and restructure
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;
+ };
+}