How to trigger a rebuild of a package made in a flake?

I have a flake, the flake defines how to build the project, then I install the project and make it available in my environment:

      # Development environments
      devShells = forEachSupportedSystem (
        { pkgs }:
        {
          default = pkgs.mkShell {
            # Pinned packages available in the environment
            packages = with pkgs; [
              go
              nil

              gomodifytags
              panicparse
              self.packages.${pkgs.system}.default
            ];
          };
        }
      );

Since I updated the vendor folder of my project I would like the package to be rebuilt with a fresh binary, how do I do that?

Is this a go package? If so, just set vendorHash = ""; in the package definition, it’ll tell you the new hash, after updating that you’ll get a fresh build.

1 Like

I have a vendor folder in my Go project, so the build fails with the following error:

       last 8 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/7filqqpimaz02az242zr1mks3z101glm-fnbzhiydz4x0p20prkzz00bldvwkwhzb-source
       > source root is fnbzhiydz4x0p20prkzz00bldvwkwhzb-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > vendor folder exists, please set 'vendorHash = null;' in your expression

Right, and if you set it to null it doesn’t trigger rebuilds when changed?

1 Like