build: Release-Pipeline (scripts/release.sh + Gitea-Workflow) und flake.nix
- scripts/release.sh baut die sechs Targets (linux/darwin/windows × amd64/arm64) statisch mit CGO_ENABLED=0, -trimpath, Version und Commit per ldflags, und schreibt checksums.txt. Asset-Vertrag für das Fleet- Rollout: talk_<os>_<arch>[.exe]. Bewusst ohne GoReleaser — dasselbe Artefakt lokal, in CI und unter nix, ohne zusätzliches Werkzeug. - .gitea/workflows/release.yml: bei Tag v* Tests, Build, Gitea-Release mit Assets (actions/gitea-release-action, Repo-Token). - flake.nix: Paket (buildGoModule, ein Binary), App, Overlay, devShell, Formatter. Linux-Wrapper legt alsa-lib in den LD_LIBRARY_PATH (oto lädt ALSA per dlopen, spricht PulseAudio/PipeWire aber direkt in Go) und espeak-ng/libnotify in den PATH. Verifiziert: nix build .#talk, nix flake check, Snapshot-Build aller sechs Targets. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e2aa506a6
commit
423377bade
3 files changed
+146
No files matched your search
@@ -0,0 +1,70 @@
|
||||
{
|
||||
# talk — Sprach-Ausgaben für Skripte und KI-Agenten.
|
||||
#
|
||||
# Nutzung in einer NixOS-/Home-Manager-Konfiguration:
|
||||
# inputs.talk.url = "git+https://code.m3ta.dev/m3tam3re/talk";
|
||||
# environment.systemPackages = [ inputs.talk.packages.${system}.talk ];
|
||||
# oder als Overlay: nixpkgs.overlays = [ inputs.talk.overlays.default ];
|
||||
#
|
||||
# Dieses Flake ersetzt langfristig m3ta-nixpkgs talk/crunch (bash + mpv).
|
||||
description = "talk — Voice-Notifications für Skripte und KI-Agenten (ein Binary, Daemon mit Queue)";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forAll = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
|
||||
version = if self ? shortRev then "0.0.0-${self.shortRev}" else "0.0.0-dirty";
|
||||
mkTalk = pkgs: pkgs.buildGoModule {
|
||||
pname = "talk";
|
||||
inherit version;
|
||||
src = self;
|
||||
subPackages = [ "cmd/talk" ];
|
||||
# Nach Änderungen an go.mod/go.sum neu setzen: `nix build` nennt den
|
||||
# erwarteten Hash.
|
||||
vendorHash = "sha256-CbF3juTA7V05hh1ElKKACddsCn4bIPeLZxsz2EZxs9I=";
|
||||
env.CGO_ENABLED = 0;
|
||||
ldflags = [ "-s" "-w" "-X" "main.version=${version}" "-X" "main.commit=${self.shortRev or "dirty"}" ];
|
||||
# Prozessgrenzen-Tests starten Daemons und binden Ports — nicht in der Sandbox.
|
||||
doCheck = false;
|
||||
# Audio: oto spricht PulseAudio/PipeWire direkt (reines Go) und fällt auf
|
||||
# ALSA zurück, das es zur Laufzeit per dlopen lädt — auf NixOS nur
|
||||
# auffindbar, wenn wir es in den Pfad legen. OS-Stimme: espeak-ng.
|
||||
nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.makeWrapper ];
|
||||
postInstall = pkgs.lib.optionalString pkgs.stdenv.isLinux ''
|
||||
wrapProgram $out/bin/talk \
|
||||
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath [ pkgs.alsa-lib ]} \
|
||||
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.espeak-ng pkgs.libnotify ]}
|
||||
'';
|
||||
meta = with pkgs.lib; {
|
||||
description = "Voice-Notifications für Skripte und KI-Agenten";
|
||||
homepage = "https://code.m3ta.dev/m3tam3re/talk";
|
||||
license = licenses.mit;
|
||||
mainProgram = "talk";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = forAll (pkgs: rec {
|
||||
talk = mkTalk pkgs;
|
||||
default = talk;
|
||||
});
|
||||
|
||||
apps = forAll (pkgs: rec {
|
||||
talk = { type = "app"; program = "${mkTalk pkgs}/bin/talk"; };
|
||||
default = talk;
|
||||
});
|
||||
|
||||
overlays.default = final: prev: { talk = mkTalk final; };
|
||||
|
||||
devShells = forAll (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = [ pkgs.go pkgs.gopls pkgs.gotools pkgs.espeak-ng pkgs.libnotify ];
|
||||
};
|
||||
});
|
||||
|
||||
formatter = forAll (pkgs: pkgs.nixfmt-rfc-style);
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user