I've been porting my manual calls to fetchurl and fetchgit with niv and it works really well, but I've encountered the following problem when fetching Firefox:
However, the filename Firefox%2078.0.2.dmg fails when we try to use it from Nix:
nix-repl> with import <darwin> {}; pkgs.sources.firefox
error: The path name 'Firefox%2078.0.2.dmg' is invalid: the '%' character is invalid. Path names are alphanumeric and can include the symbols +-._?= and must not begin with a period. Note: If 'Firefox%2078.0.2.dmg' is a source file and you cannot rename it on disk, builtins.path { name = ... } can be used to give it an alternative name.
Swapping the %20 for a space also fails for the same reason.
This could be avoided by allowing the resulting name to be overridden via sources.json, but the default sources.nix doesn't seem to allow this at the moment. Alternatively, the name could be sanitised like the tarball type does (switching to that type doesn't work in this case, since it's not a tarball, so tar dies).
I've been porting my manual calls to
fetchurl
andfetchgit
withniv
and it works really well, but I've encountered the following problem when fetching Firefox:The resulting
sources.json
gets this added:However, the filename
Firefox%2078.0.2.dmg
fails when we try to use it from Nix:Swapping the
also fails for the same reason.
%20
for a spaceThis could be avoided by allowing the resulting name to be overridden via
sources.json
, but the defaultsources.nix
doesn't seem to allow this at the moment. Alternatively, the name could be sanitised like thetarball
type does (switching to that type doesn't work in this case, since it's not a tarball, sotar
dies).