aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/hsu/package.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-06-25 03:59:52 +0900
committerOphestra <cat@gensokyo.uk>2025-06-25 04:57:41 +0900
commit87e008d56de974947ebb99c2cc40b25d3c2cf43e (patch)
tree31791911e5226d6ec04e3fac7d91b0bf53e63aa5 /cmd/hsu/package.nix
parent399207321265307bb15f37d867f9370cd51c82a8 (diff)
treewide: rename to hakurei
Fortify makes little sense for a container tool. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/hsu/package.nix')
-rw-r--r--cmd/hsu/package.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/hsu/package.nix b/cmd/hsu/package.nix
new file mode 100644
index 00000000..96ec5630
--- /dev/null
+++ b/cmd/hsu/package.nix
@@ -0,0 +1,30 @@
+{
+ lib,
+ buildGoModule,
+ hakurei ? abort "hakurei package required",
+}:
+
+buildGoModule {
+ pname = "${hakurei.pname}-hsu";
+ inherit (hakurei) version;
+
+ src = ./.;
+ inherit (hakurei) vendorHash;
+ env.CGO_ENABLED = 0;
+
+ preBuild = ''
+ go mod init hsu >& /dev/null
+ '';
+
+ ldflags =
+ lib.attrsets.foldlAttrs
+ (
+ ldflags: name: value:
+ ldflags ++ [ "-X main.${name}=${value}" ]
+ )
+ [ "-s -w" ]
+ {
+ hmain = "${hakurei}/libexec/hakurei";
+ fpkg = "${hakurei}/libexec/fpkg";
+ };
+}