From 63bc2f18ff63e359229830f2feda995af580b2be Mon Sep 17 00:00:00 2001 From: Jo Date: Wed, 25 Dec 2024 23:32:40 +0100 Subject: [PATCH] feat(lib): add mkOpt function --- lib/module/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/module/default.nix diff --git a/lib/module/default.nix b/lib/module/default.nix new file mode 100644 index 0000000..6f99f78 --- /dev/null +++ b/lib/module/default.nix @@ -0,0 +1,16 @@ +{ + lib, + ... +}: with lib; +rec { + ## Create a NixOS module option. (Stolen from Jake Hamilton) + ## + ## ```nix + ## lib.mkOpt nixpkgs.lib.types.str "My default" "Description of my option." + ## ``` + ## + #@ Type -> Any -> String + mkOpt = + type: default: description: + mkOption { inherit type default description; }; +}