diff options
-rwxr-xr-x | lib/tests/modules.sh | 2 | ||||
-rw-r--r-- | lib/tests/modules/declare-mkPackageOption.nix | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index c2f1a426a342..21d4978a1160 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -235,6 +235,8 @@ checkConfigOutput '^".*Example extra description\..*"$' options.packageWithExtra checkConfigError 'The option .undefinedPackage. is used but not defined' config.undefinedPackage ./declare-mkPackageOption.nix checkConfigOutput '^null$' config.nullablePackage ./declare-mkPackageOption.nix checkConfigOutput '^"null or package"$' options.nullablePackageWithDefault.type.description ./declare-mkPackageOption.nix +checkConfigOutput '^"myPkgs\.hello"$' options.packageWithPkgsText.defaultText.text ./declare-mkPackageOption.nix +checkConfigOutput '^"hello-other"$' options.packageFromOtherSet.default.pname ./declare-mkPackageOption.nix # submoduleWith diff --git a/lib/tests/modules/declare-mkPackageOption.nix b/lib/tests/modules/declare-mkPackageOption.nix index 37f070467b42..e13e68447e09 100644 --- a/lib/tests/modules/declare-mkPackageOption.nix +++ b/lib/tests/modules/declare-mkPackageOption.nix @@ -41,5 +41,13 @@ in { nullablePackageWithDefault = lib.mkPackageOption pkgs "hello" { nullable = true; }; + + packageWithPkgsText = lib.mkPackageOption pkgs "hello" { + pkgsText = "myPkgs"; + }; + + packageFromOtherSet = let myPkgs = { + hello = pkgs.hello // { pname = "hello-other"; }; + }; in lib.mkPackageOption myPkgs "hello" { }; }; } |