Given a newly created flake (using nix flake init), and the following flake.lock file:
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1764950072,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f61125a668a320878494449750330ca58b78c557",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
How do I precalculate the narHash for the nixpkgs input?
I tried the following but those produced different outputs:
$ nix-prefetch-url https://github.com/nixos/nixpkgs/archive/f61125a668a320878494449750330ca58b78c557.tar.gz
#=> path is '/nix/store/fxcafl2s6n7ixxpv8i6dkbzs786gfx0d-f61125a668a320878494449750330ca58b78c557.tar.gz'
#=> 035r92kgv4sbslwi3ss63n53hplm8s5csqd2mzxrlkxpxx8v8476
$ nix-prefetch-url https://github.com/nixos/nixpkgs/archive/f61125a668a320878494449750330ca58b78c557.tar.gz --unpack
#=> path is '/nix/store/g8v1l82j4wnz6avqcvby7x82jwbcrrc3-f61125a668a320878494449750330ca58b78c557.tar.gz'
#=> 003z6rp3b69pcn8v34b1mq69w1bh2gilyrcvbnn626rci37dcqq6