snowfallorg / nix-software-center

A simple gtk4/libadwaita software center to easily install and manage nix packages
GNU General Public License v3.0
560 stars 16 forks source link

shasum error during rebuild #3

Closed tebowy closed 1 year ago

tebowy commented 1 year ago

I've added this repo as a let…in in configuration.nix, addedd the package to the system list, and am getting this error on system rebuild.

~ ❱ sudo nixos-rebuild switch --show-trace 
building Nix...
building the system configuration...
building '/nix/store/lv93q2qi0lqsk9ijksf5biabg4yb7lnx-source.drv'...

trying https://github.com/vlinkz/nixos-conf-editor/archive/0.0.5.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  671k    0  671k    0     0   826k      0 --:--:-- --:--:-- --:--:--  826k
unpacking source archive /build/0.0.5.tar.gz
error: hash mismatch in fixed-output derivation '/nix/store/lv93q2qi0lqsk9ijksf5biabg4yb7lnx-source.drv':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
            got:    sha256-Wst1UmVuE5L+1y6c96I62bXSBAcGYus3i7PFEPd4Jv0=

       … while realising the context of path '/nix/store/bqfq4db6nwycmkdrql9igsbrayqsw3g2-source'

       at /etc/nixos/configuration.nix:10:24:

            9| let
           10|   nixos-conf-editor = (import (pkgs.fetchFromGitHub {
             |                        ^  
           11|     owner = "vlinkz";

       … while evaluating the attribute 'value'

~ 6.4s [102]

How to fix the configuration?

Running once-off works with the enable-experimenal flakes command.

vlinkz commented 1 year ago

In the configuration file, try changing

    sha256 = "0000000000000000000000000000000000000000000000000000";

to

    sha256 = "sha256-Wst1UmVuE5L+1y6c96I62bXSBAcGYus3i7PFEPd4Jv0=";

I don't have the actual sha hash in the readme since it changes every update (although I probably could do it for tag releases, I'll look into it), but in your error output it shows

         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
            got:    sha256-Wst1UmVuE5L+1y6c96I62bXSBAcGYus3i7PFEPd4Jv0=

so replacing the zeros with the got value should fix this in the future as well

tebowy commented 1 year ago

Thanks, that did help (I've got the v3 tag anyway from readme)