# Poetry2nix fails to grab hash of dependency

**URL:** https://discourse.nixos.org/t/poetry2nix-fails-to-grab-hash-of-dependency/50416
**Category:** Help
**Created:** [August 10, 2024, 1:25pm UTC](https://discourse.nixos.org/t/poetry2nix-fails-to-grab-hash-of-dependency/50416 "2024-08-10T13:25:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pasqui23](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@pasqui23](https://discourse.nixos.org/u/pasqui23)
#### Post date: [August 10, 2024, 1:25pm UTC](https://discourse.nixos.org/t/poetry2nix-fails-to-grab-hash-of-dependency/50416/1 "2024-08-10T13:25:44Z")

</div>

Building

```nix
{src,poetry2nix,pkgs,fetchFromGitHub}:
let
      inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication overrides;
in
mkPoetryApplication {
	projectDir=src; #taken from flake input
	overrides = overrides.withDefaults(final: prev:{
		orjson = prev.orjson.overrideAttrs(old:{
			src=fetchFromGitHub{
				inherit(old.src)owner repo rev;
				hash = "sha256-gKcj4LbmEx1QiDObial0+OJJmcLpjox5rPqVSHuf6tk=";
			};
		});
	});
}

```

the build fails with :

```auto
; nix build '.#fabric'
error:
       … while evaluating the attribute 'drvPath'

         at /nix/store/0jr2kk95c34c0b6yxi75q4fqgb43kqkm-source/lib/customisation.nix:365:7:

          364| in commonAttrs // {
          365| drvPath = assert condition; drv.drvPath;
             | ^
          366| outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: hash mismatch in fixed-output derivation '/nix/store/7q53lc055sa7d30im6jnngfskpbg0h5l-source.drv':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
            got: sha256-gKcj4LbmEx1QiDObial0+OJJmcLpjox5rPqVSHuf6tk=
; nix log '/nix/store/7q53lc055sa7d30im6jnngfskpbg0h5l-source.drv'
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/7q53lc055sa7d30im6jnngfskpbg0h5l-source.drv^*'
sourcing setup hook '/nix/store/dv5vgsw8naxnkcc88x78vprbnn1pp44y-patchelf-0.15.0/nix-support/setup-hook'
sourcing setup hook '/nix/store/i4iynx9axbq23sd0gyrc5wdb46zz6z8l-update-autotools-gnu-config-scripts-hook/nix-support/setup-hook'
sourcing setup hook '/nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh'
sourcing setup hook '/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh'
sourcing setup hook '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh'
sourcing setup hook '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh'
sourcing setup hook '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh'
sourcing setup hook '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh'
sourcing setup hook '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh'
sourcing setup hook '/nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh'
sourcing setup hook '/nix/store/ilaf1w22bxi6jsi45alhmvvdgy4ly3zs-patch-shebangs.sh'
sourcing setup hook '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh'
sourcing setup hook '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh'
sourcing setup hook '/nix/store/aazf105snicrlvyzzbdj85sx4179rpfp-set-source-date-epoch-to-latest.sh'
sourcing setup hook '/nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh'

trying https://github.com/ijl/orjson/archive/3.10.0.tar.gz
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 887k 0 887k 0 0 1016k 0 --:--:-- --:--:-- --:--:-- 1501k
evaling implicit 'postFetch' string hook
unpacking source archive /build/3.10.0.tar.gz
calling 'unpackCmd' function hook '_defaultUnpack' /build/3.10.0.tar.gz

```

Why

---

<div class="post-metadata">

### Author: ![mightyiam](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mightyiam/32/33998_2.png) [@mightyiam](https://discourse.nixos.org/u/mightyiam)
#### Post date: [August 10, 2024, 4:40pm UTC](https://discourse.nixos.org/t/poetry2nix-fails-to-grab-hash-of-dependency/50416/2 "2024-08-10T16:40:21Z")

</div>

> [@pasqui23](#):
>
> ```auto
> error: hash mismatch in fixed-output derivation '/nix/store/7q53lc055sa7d30im6jnngfskpbg0h5l-source.drv':
> specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
> got: sha256-gKcj4LbmEx1QiDObial0+OJJmcLpjox5rPqVSHuf6tk=
> 
> ```

At this point you usually replace an empty hash attribute with the value of “got”.

---

<div class="post-metadata">

### Author: ![pasqui23](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@pasqui23](https://discourse.nixos.org/u/pasqui23)
#### Post date: [August 10, 2024, 11:27pm UTC](https://discourse.nixos.org/t/poetry2nix-fails-to-grab-hash-of-dependency/50416/3 "2024-08-10T23:27:06Z")

</div>

ok but I only wrote the above file. I expected that poetry2nix would extract the hash from the lock file or at least that the overlay would correct it

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [August 11, 2024, 12:48am UTC](https://discourse.nixos.org/t/poetry2nix-fails-to-grab-hash-of-dependency/50416/4 "2024-08-11T00:48:20Z")

</div>

Overlays have nothing to do with setting hashes. Also, please share an example that we can build ourselves, as this isn’t sufficient to help troubleshoot IMO.
