feat(lib): Add mkEnableModule function

This commit is contained in:
punkfairie 2024-11-15 19:05:46 -08:00
parent 6f255b10a3
commit 654088a3f9
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696

View file

@ -1,6 +1,16 @@
{ lib, ... }: { lib, namespace, ... }:
with lib; with lib;
rec { 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. ## Create a NixOS module option.
## ##
## ```nix ## ```nix