I was trying to setup simple nixos mailserver on a machine. The readme contains a snippet that is to be added to the configuration.nix, and then I’m supposed to update the sha256 hash to the correct one. This is what a nixos-rebuild test
printed after I added the snippet in the readme:
[root@server:/etc/nixos]# nixos-rebuild test
error: hash mismatch in file downloaded from 'https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.3.0/nixos-mailserver-v2.3.0.tar.gz':
wanted: sha256:0000000000000000000000000000000000000000000000000000
got: sha256:0lpz08qviccvpfws2nm83n7m2r8add2wvfg9bljx9yxx8107r919
(use '--show-trace' to show detailed location information)
building Nix...
error: hash mismatch in file downloaded from 'https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.3.0/nixos-mailserver-v2.3.0.tar.gz':
wanted: sha256:0000000000000000000000000000000000000000000000000000
got: sha256:0lpz08qviccvpfws2nm83n7m2r8add2wvfg9bljx9yxx8107r919
(use '--show-trace' to show detailed location information)
building the system configuration...
error: hash mismatch in file downloaded from 'https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.3.0/nixos-mailserver-v2.3.0.tar.gz':
wanted: sha256:0000000000000000000000000000000000000000000000000000
got: sha256:0lpz08qviccvpfws2nm83n7m2r8add2wvfg9bljx9yxx8107r919
(use '--show-trace' to show detailed location information)
Before updating the sha, I downloaded the tarball manually and calculated it’s sha256sum, which came out different from the one calculated and expected by nix:
$ sha256sum ~/Downloads/nixos-mailserver-v2.3.0.tar.gz
e55c72dabca95fb5faf22ac15a08e58981a64989a302ce25e79a4f1df1d93fa5 /home/fctorial/Downloads/nixos-mailserver-v2.3.0.tar.gz
What is the reason for this discrepency?