cabal2nix
cabal2nix copied to clipboard
file:// will ignore a cabal file
When I run
> cabal2nix file://./yarn2nix/yarn2nix.cabal > yarn2nix/yarn2nix.nix
error: unable to download 'https://hackage.haskell.org/package/yarn2nix-0.9.0.tar.gz': HTTP error 404 ('Not Found')
response body:
Package not found: No such package version for yarn2nix
*** cannot compute hash. (Not a hackage project?)
If your project is not on hackage, please supply the path to the root directory of
the project, not to the cabal file.
If your project is on hackage but you still want to specify the hash manually, you
can use the --sha256 option.
cabal2nix starts downloading things and complains.
I expect it to use the .cabal file and convert it to a nix file.
cabal2nix starts downloading things and complains.
Isn't this expected, since it needs to get the hash of a clean tarball? The README states:
Alternatively [...] a
file:///local/path/pkg.cabalURI that doesn't depend on network access. However, if the source hash is not already incabal2nix's cache or provided using the--sha256option,cabal2nixstill needs to download the source code to compute the hash, which still causes network traffic.
In 0.9.0 of yarn2nix, which is not released on hackage, specifying the path to the root directory of the project as mentioned in the error behaves as expected; cabal2nix file://./yarn2nix/. outputs a Nix expression, whereas cabal2nix file://./yarn2nix/yarn2nix.cabal gives me the error.