hey everyone, just starting out with haskell and trying to make a toy project with hyperbole. When override the package version with haskellProjects.default.packages.hyperbole.source = "0.5.0";
I get following error:
> nix develop
warning: Git tree '/home/a/projects/haskell-exercises' is dirty
error: builder for '/nix/store/qb5jz3a8jn03khibmfjxp8sq8mx6d98b-all-cabal-hashes-component-hyperbole-0.5.0.drv' failed with exit code 2;
last 3 log lines:
> tar: */hyperbole/0.5.0/hyperbole.json: Not found in archive
> tar: */hyperbole/0.5.0/hyperbole.cabal: Not found in archive
> tar: Exiting with failure status due to previous errors
For full logs, run:
nix log /nix/store/qb5jz3a8jn03khibmfjxp8sq8mx6d98b-all-cabal-hashes-component-hyperbole-0.5.0.drv
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'ghc-shell-for-packages-0'
whose name attribute is located at /nix/store/ybmnblw90230yl4p0l18ghwx9ry597bz-source/pkgs/stdenv/generic/make-derivation.nix:544:13
… while evaluating attribute 'NIX_GHC' of derivation 'ghc-shell-for-packages-0'
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: 1 dependencies of derivation '/nix/store/z8nd9zdv0za59irx46mnv5swvsydjpqg-cabal2nix-hyperbole-0.5.0.drv' failed to build
what am I doing wrong?
I tried setting it up via flake input, but that fails due to a broken test in the dependency flake input atomic-css. Yikes!
ok I figured out how to overcome this, run cabal2nix for a package and then use that instead of overriding the source number
hyperbole = { super, ...}: { custom = _: super.callPackage ./hyperbole.nix {}; };
tar: */hyperbole/0.5.0/hyperbole.json: Not found in archive
tar: */hyperbole/0.5.0/hyperbole.cabal: Not found in archive
@Pavel Anpin
It means that hyperbole 0.5.0 is not in the all-cabal-hashes
registry.
To fix the error, you will have to update the all-cabal-hashes
revision to latest. You can do that by either updating nixpkgs
(assuming someone has updated it upstream) or DIY:
# In haskellProjects.<name>
{
basePackages = pkgs.haskellPackages.override {
all-cabal-hashes = builtins.fetchurl { url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/LATEST-COMMIT-HERE.tar.gz"; sha256 = lib.fakeHash; };
};
}
brilliant! I knew I was missing something out. Quick search pointed on updating cabal, but I went into fetching derivations manually. Thanks!
Alternatively, you can directly point to the source: https://community.flake.parts/haskell-flake/dependency#source
Last updated: Oct 16 2025 at 05:45 UTC