From 654088a3f9e7e1c1f6000ee2445163fae31219ae Mon Sep 17 00:00:00 2001 From: punkfairie Date: Fri, 15 Nov 2024 19:05:46 -0800 Subject: [PATCH] feat(lib): Add mkEnableModule function --- lib/module/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/module/default.nix b/lib/module/default.nix index 15a46ec..4a726c3 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -1,6 +1,16 @@ -{ lib, ... }: +{ lib, namespace, ... }: with lib; rec { + ## Create a module option with only an enable option. + ## ```nix + ## options = lib.mkEnableModule "module-name" + ## ``` + ## + #@ String + mkEnableModule = name: { + ${namespace}.${name}.enable = mkEnableModule "${name}"; + }; + ## Create a NixOS module option. ## ## ```nix