hakurei/cmd/fsu/package.nix
Ophestra 9a66fbfb50
Some checks failed
Test / Create distribution (push) Successful in 31s
Test / Sandbox (push) Successful in 1m56s
Test / Sandbox (race detector) (push) Successful in 3m6s
Test / Fpkg (push) Successful in 3m40s
Test / Fortify (race detector) (push) Failing after 4m19s
Test / Fortify (push) Failing after 2m21s
Test / Flake checks (push) Has been skipped
nix: update flake lock
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-06-04 02:59:12 +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";
};
}