Help packaging `traggo`

I’m currently trying to package traggo. Here’s my current package but I’m failing with the vendorHash.

Note: I have zero experience with go.

{ lib
, buildGoModule
, fetchFromGitHub
,
}:
buildGoModule rec {
  pname = "traggo";
  version = "0.8.2";

  src = fetchFromGitHub {
    owner = "traggo";
    repo = "server";
    rev = "v${version}";
    hash = "sha256-ls8dM8+R/SbfhS3m4aKIYfMNOFue5ZIFJkjpph3Unzs=";
  };

  vendorHash = lib.fakeHash;

  meta = {
    description = "Self-hosted tag-based time tracking";
    homepage = "https://github.com/traggo/server";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ tornax ];
  };
}

If I do nix build .#traggo now, then I’m getting the following output instead of a expected hash:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/ajm04111p5zfkp8wck276rgy05mhv620-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
go: downloading github.com/gorilla/mux v1.8.1
go: downloading github.com/jmattheis/go-timemath v1.0.1
go: downloading github.com/rs/zerolog v1.34.0
go: downloading github.com/jinzhu/gorm v1.9.2
go: downloading github.com/99designs/gqlgen v0.17.85
go: downloading github.com/stretchr/testify v1.11.1
go: downloading github.com/joho/godotenv v1.5.1
go: downloading github.com/jinzhu/copier v0.4.0
go: downloading github.com/kelseyhightower/envconfig v1.4.0
go: downloading github.com/magiconair/properties v1.8.10
go: downloading golang.org/x/crypto v0.46.0
go: downloading github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
go: downloading github.com/go-sql-driver/mysql v1.4.1
go: downloading github.com/lib/pq v1.0.0
go: downloading github.com/mattn/go-sqlite3 v1.10.0
go: downloading github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading google.golang.org/appengine v1.3.0
go: downloading golang.org/x/sys v0.39.0
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading github.com/sosodev/duration v1.3.1
go: downloading github.com/vektah/gqlparser/v2 v2.5.31
go: downloading github.com/gorilla/websocket v1.5.0
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/hashicorp/golang-lru/v2 v2.0.7
go: downloading github.com/go-viper/mapstructure/v2 v2.4.0
go: downloading github.com/agnivade/levenshtein v1.2.1
go: github.com/traggo/server/auth imports
        github.com/traggo/server/generated/gqlmodel: no required module provides package github.com/traggo/server/generated/gqlmodel; to add it:
        go get github.com/traggo/server/generated/gqlmodel
go: github.com/traggo/server/graphql imports
        github.com/traggo/server/generated/gqlschema: no required module provides package github.com/traggo/server/generated/gqlschema; to add it:
        go get github.com/traggo/server/generated/gqlschema

I have absolutely no idea what I should do now.

I tried to follow this answer https://discourse.nixos.org/t/solved-cant-get-vendorhash-for-buildgomodule/64905/3 but I don’t know what nom is and I can’t find it in the package search (I doubt that it’s the rss-reader…).

nom is “nix output monitor” and really not related to your problem nor to finding a solution to your problem.

It just is a fancy way to display a tree while building.

On a first glance your actual problem seems tto be, that there are generated packages referenced somehow, which are not yet generated, but go wants to read to see if they depend on any external modules to fetch.

If you are lucky, wrapping FFG in drv that runs make generate and copies everything into its $out then might work. but that really is just an idea. I have not looked into how complex the actual code generation is.

I made a build for traggo just before christmas: GitHub - Skeen/traggo - But it is not reproducible due to some of the same reasons you’ve encounter. Just wanted to drop it here in case it’s useful to you.

I do think it may be possible to make a reproducible build now though, as traggo has updated the dependencies recently.