diff --git a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/all-packages.nix index 95478a87fb32..3fbe2d5e51dc 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/all-packages.nix +++ b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/all-packages.nix @@ -1,3 +1,4 @@ self: super: { foo = self._internalCallByNamePackageFile ./foo.nix; + bar = self._internalCallByNamePackageFile ./foo.nix; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/pkgs/by-name/fo/foo/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/pkgs/by-name/fo/foo/package.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/internalCallPackage/pkgs/by-name/fo/foo/package.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv diff --git a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/all-packages.nix new file mode 100644 index 000000000000..3398e974cb6b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/all-packages.nix @@ -0,0 +1,3 @@ +self: super: builtins.mapAttrs (name: value: value) { + foo = self.someDrv; +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected new file mode 100644 index 000000000000..9df788191ece --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/expected @@ -0,0 +1 @@ +pkgs.foo: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/fo/foo/package.nix { ... }` with a non-empty second argument. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/pkgs/by-name/fo/foo/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/pkgs/by-name/fo/foo/package.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/unknown-location/pkgs/by-name/fo/foo/package.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv