hakurei/cmd/fsu/package.nix
Ophestra 577f20de86
Some checks failed
Test / Create distribution (push) Successful in 26s
Test / Sandbox (push) Successful in 2m23s
Test / Sandbox (race detector) (push) Successful in 3m17s
Test / Fpkg (push) Successful in 4m21s
Test / Fortify (race detector) (push) Failing after 6m16s
Test / Fortify (push) Failing after 2m7s
Test / Flake checks (push) Has been skipped
nix: update flake lock
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-06-03 05:38:56 +09:00

31 lines
542 B
Nix

{
lib,
buildGoModule,
fortify ? abort "fortify package required",
}:
buildGoModule {
pname = "${fortify.pname}-fsu";
inherit (fortify) version;
src = ./.;
inherit (fortify) vendorHash;
env.CGO_ENABLED = 0;
preBuild = ''
go mod init fsu >& /dev/null
'';
ldflags =
lib.attrsets.foldlAttrs
(
ldflags: name: value:
ldflags ++ [ "-X main.${name}=${value}" ]
)
[ "-s -w" ]
{
fmain = "${fortify}/libexec/fortify";
fpkg = "${fortify}/libexec/fpkg";
};
}