74_deb-package-release #75
1 changed files with 42 additions and 0 deletions
42
flake.nix
42
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 <<EOF
|
||||
name: streamd
|
||||
arch: amd64
|
||||
platform: linux
|
||||
version: "${version}"
|
||||
maintainer: Konstantin Fickel
|
||||
description: Personal knowledge management and time-tracking CLI using @Tag annotations
|
||||
license: AGPL-3.0-only
|
||||
homepage: https://git.konstantinfickel.de/kfickel/streamd
|
||||
contents:
|
||||
- src: ${streamd-musl}/bin/streamd
|
||||
dst: /usr/bin/streamd
|
||||
file_info:
|
||||
mode: 0755
|
||||
- src: completions/streamd.bash
|
||||
dst: /usr/share/bash-completion/completions/streamd
|
||||
- src: completions/_streamd
|
||||
dst: /usr/share/zsh/vendor-completions/_streamd
|
||||
- src: completions/streamd.fish
|
||||
dst: /usr/share/fish/vendor_completions.d/streamd.fish
|
||||
deb:
|
||||
compression: gzip
|
||||
EOF
|
||||
|
||||
nfpm package --config nfpm.yaml --packager deb --target $out
|
||||
'';
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue