From 8bf162820b291cc3889fd05f4ba7cd4fcbc1d15d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 23 Feb 2025 18:13:06 +0900 Subject: nix: separate fsu from package This appears to be the only way to build them with different configuration. This enables static linking in the main package. Signed-off-by: Ophestra --- cmd/fsu/package.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cmd/fsu/package.nix (limited to 'cmd/fsu/package.nix') diff --git a/cmd/fsu/package.nix b/cmd/fsu/package.nix new file mode 100644 index 00000000..e7a7a1eb --- /dev/null +++ b/cmd/fsu/package.nix @@ -0,0 +1,19 @@ +{ + buildGoModule, + fortify ? abort "fortify package required", +}: + +buildGoModule { + pname = "${fortify.pname}-fsu"; + inherit (fortify) version; + + src = ./.; + inherit (fortify) vendorHash; + CGO_ENABLED = 0; + + preBuild = '' + go mod init fsu >& /dev/null + ''; + + ldflags = [ "-X main.Fmain=${fortify}/libexec/fortify" ]; +} -- cgit v1.3.1