diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-11-08 21:44:44 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-11-08 21:44:44 +0100 |
commit | e07e80e8419f35d596712ecfff57259f0230a33c (patch) | |
tree | 145e19622792d033b4a6cfd65f1b0c0eaf5baa06 /lib/fileset/internal.nix | |
parent | 73493584a74cddb22d785942a2215c3dab12c29e (diff) |
lib.fileset.toSource: Mention fromSource in errors
Diffstat (limited to 'lib/fileset/internal.nix')
-rw-r--r-- | lib/fileset/internal.nix | 7 |
1 files changed, 6 insertions, 1 deletions
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.'' |