From 8b210a3b41aa2dcab0715b2083900decc7adf251 Mon Sep 17 00:00:00 2001 From: Konstantin Fickel Date: Thu, 2 Apr 2026 22:55:14 +0200 Subject: [PATCH] feat(flake): add .deb packaging with shell completions Add mkStreamdDeb function that uses nfpm to create a .deb package containing the statically-linked binary and shell completions for bash, zsh, and fish. --- flake.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/flake.nix b/flake.nix index 9f0f395..e1783e8 100644 --- a/flake.nix +++ b/flake.nix @@ -131,6 +131,48 @@ cargoArtifacts = craneLib.buildDepsOnly commonArgs; in craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; }); + + mkStreamdDeb = + system: + let + pkgs = mkPkgs system; + streamd-musl = mkStreamdMusl system; + in + pkgs.runCommand "streamd_${version}_amd64.deb" { + nativeBuildInputs = [ pkgs.nfpm ]; + } '' + # Generate shell completions + mkdir -p completions + ${streamd-musl}/bin/streamd completions bash > completions/streamd.bash + ${streamd-musl}/bin/streamd completions zsh > completions/_streamd + ${streamd-musl}/bin/streamd completions fish > completions/streamd.fish + + cat > nfpm.yaml <