Skip to content

Commit d7ff136

Browse files
authored
Allow passing a tarball to hackage2nix without a url (#2014)
cabal has started using XDG paths for the index and a quick fix is to just pass hackage2nix the path to the tarball. But so far we are forced to specify an url as well, which is not needed when you use hackageTarball. This difference in behaviour causes all nix files to change. This change allows passing a tarball and no url, just like we do with hackage.
1 parent 565db16 commit d7ff136

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

nix-tools/hackage2nix/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ main = do
6666
(inp, src) <- case rest of
6767
[tarball, url, hash] -> return (tarball, Just $ Repo url (Just hash))
6868
[tarball, url] -> return (tarball, Just $ Repo url Nothing)
69+
[tarball] -> return (tarball, Nothing)
6970
[] -> hackageTarball >>= \tarball -> return (tarball, Nothing)
7071

7172
db <- U.readTarball Nothing inp

0 commit comments

Comments
 (0)