summary refs log tree commit diff
path: root/lib/tests/modules
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tests/modules')
-rw-r--r--lib/tests/modules/declare-mkPackageOption.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/tests/modules/declare-mkPackageOption.nix b/lib/tests/modules/declare-mkPackageOption.nix
new file mode 100644
index 00000000000..640b19a7bf2
--- /dev/null
+++ b/lib/tests/modules/declare-mkPackageOption.nix
@@ -0,0 +1,19 @@
+{ lib, ... }: let
+  pkgs.hello = {
+    type = "derivation";
+    pname = "hello";
+  };
+in {
+  options = {
+    package = lib.mkPackageOption pkgs "hello" { };
+
+    undefinedPackage = lib.mkPackageOption pkgs "hello" {
+      default = null;
+    };
+
+    nullablePackage = lib.mkPackageOption pkgs "hello" {
+      nullable = true;
+      default = null;
+    };
+  };
+}