From e07e80e8419f35d596712ecfff57259f0230a33c Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Wed, 8 Nov 2023 21:44:44 +0100 Subject: lib.fileset.toSource: Mention fromSource in errors --- lib/fileset/internal.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/fileset/internal.nix') diff --git a/lib/fileset/internal.nix b/lib/fileset/internal.nix index 031262520785d..45115d5a8a3dc 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.'' -- cgit 1.4.1