| 15 Jan 2024 |
fionera | * Hi, I am currently migrating a software I maintain to nix and I am wondering what the best practice for a repository with multiple go binaries but one go.mod would be | 14:18:35 |
@qbit:tapenet.org | fionera: hi! | 14:19:20 |
@qbit:tapenet.org | there's a subPackages opiton you can set that list all the various places things live | 14:19:36 |
@qbit:tapenet.org | for buildGoModule | 14:19:51 |
fionera | but how would I package it without having to set the vendor hash every time? :D | 14:20:05 |
@qbit:tapenet.org | by default it builds ./... | 14:20:12 |
@qbit:tapenet.org | uh, you should only have to set it once for every change of deps | 14:20:24 |
@qbit:tapenet.org | do you have external C deps? | 14:20:30 |
@qbit:tapenet.org | if so you will need to set proxyVendor = true; or the hash can change every build | 14:20:49 |
fionera | No but I hoped to even skip the initial pinning :D | 14:20:49 |
fionera | I am migrating vom bazel to nix | 14:21:08 |
@qbit:tapenet.org | only way to do that is to have your stuff vendor'd already | 14:21:14 |
@qbit:tapenet.org | as in go mod vendor; git add vindor; git commit ... etc | 14:21:26 |
@qbit:tapenet.org | and then cut a new release | 14:21:32 |
@qbit:tapenet.org | not ideal | 14:21:34 |
fionera | yeah vendoring isnt possible as I am importing k8s and friends | 14:21:52 |
@qbit:tapenet.org | typically you just have src.hash = "" and vendorHash = "", then run nix-build 2x | 14:22:13 |
@qbit:tapenet.org | filling in the hashes as they come | 14:22:17 |
fionera | ok :D Thank you very much :) | 14:23:01 |
@qbit:tapenet.org | np! | 14:24:43 |
Paul Meyer (katexochen) | fionera: or use nix-update, for example nix-update --version=skip --flake <package-attr> will update the vendor hash of a local package. | 14:55:58 |
Paul Meyer (katexochen) | * fionera: or use nix-update, for example nix-update --version=skip --flake <package-attr> will update the vendor hash of a local package in a nix flake. | 14:56:12 |
Paul Meyer (katexochen) | * fionera: or use nix-update, for example nix-update --version=skip --flake <package-attr> will update the vendor hash of a local package in a nix flake. | 15:18:17 |