headplane/nix/agent.nix
Igor Ramazanov 8268de92c4 feat: do not rely on git for versioning
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.
2025-03-11 22:49:18 +00:00

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;
}