It causes lots of pain when building with `nix` for a local `flake.nix`. Not sure if it's a good general solution: * now it requires a manual step of updating `./version` on each release. * we're losing commit hash abbreviation, like `0.5.3-5-gbe5a291` I guess, this can be fixed by installing git-pre-commit-hook, but even then it'd be wrong, because the output of `git describe --tags --always` won't be the same before and after commit.
10 lines
269 B
Nix
10 lines
269 B
Nix
{buildGoModule}:
|
|
buildGoModule {
|
|
pname = "hp_agent";
|
|
version = builtins.replaceStrings ["\n"] [""] (builtins.readFile ../version);
|
|
src = ../.;
|
|
vendorHash = "sha256-G0kahv3mPTL/mxU2U+0IytJaFVPXMbMBktbLMfM0BO8=";
|
|
ldflags = ["-s" "-w"];
|
|
env.CGO_ENABLED = 0;
|
|
}
|