Hello all,
Is anyone able to tell me what I’m doing wrong here?
$ nix-prefetch-url https://github.com/NixOS/nixpkgs/archive/nixos-23.05.tar.gz --unpack
path is '/nix/store/6cjg3y7q5gg3ps4z3xcap731igs7i0kd-nixos-23.05.tar.gz'
0ha53gbglrcnpzfc4lwzgyvlsagvm1m2q9z5i5b4nfahplnqpsbj
Then (note the hash is copied and pasted over here)
$ nix build -j0 --impure --no-link --print-out-paths --expr \
'with import
(fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/nixos-23.05.tar.gz";
sha256 = "0ha53gbglrcnpzfc4lwzgyvlsagvm1m2q9z5i5b4nfahplnqpsbj";
}) { };
stdenv.mkDerivation {
name = "test_package";
unpackPhase = "true";
installPhase = "echo hello > $out";
}'
error: hash mismatch in file downloaded from 'https://github.com/NixOS/nixpkgs/archive/nixos-23.05.tar.gz':
specified: sha256:0ha53gbglrcnpzfc4lwzgyvlsagvm1m2q9z5i5b4nfahplnqpsbj
got: sha256:166yxg4ff2jxvl9mbngd90dr1k3rdj6xmiccga41xynhh2zr0vmb
If I am misusing nix-prefetch-url
somehow (… which I presume I am), can anyone tell me a better way to get the hash in advance?
Thanks!