summaryrefslogtreecommitdiff
path: root/lib/fileset/internal.nix
diff options
context:
space:
mode:
authorSilvan Mosberger <silvan.mosberger@tweag.io>2023-11-08 21:44:44 +0100
committerSilvan Mosberger <silvan.mosberger@tweag.io>2023-11-08 21:44:44 +0100
commite07e80e8419f35d596712ecfff57259f0230a33c (patch)
tree145e19622792d033b4a6cfd65f1b0c0eaf5baa06 /lib/fileset/internal.nix
parentlib.fileset.fromSource: init (diff)
downloadnixpkgs-e07e80e8419f35d596712ecfff57259f0230a33c.tar.gz
lib.fileset.toSource: Mention fromSource in errors
Diffstat (limited to 'lib/fileset/internal.nix')
-rw-r--r--lib/fileset/internal.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/fileset/internal.nix b/lib/fileset/internal.nix
index 031262520785..45115d5a8a3d 100644
--- a/lib/fileset/internal.nix
+++ b/lib/fileset/internal.nix
@@ -170,7 +170,12 @@ rec {
else
value
else if ! isPath value then
- if isStringLike value then
+ if value ? _isLibCleanSourceWith then
+ throw ''
+ ${context} is a `lib.sources`-based value, but it should be a file set or a path instead.
+ To convert a `lib.sources`-based value to a file set you can use `lib.fileset.fromSource`.
+ Note that this only works for sources created from paths.''
+ else if isStringLike value then
throw ''
${context} ("${toString value}") is a string-like value, but it should be a file set or a path instead.
Paths represented as strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.''