vhs: use finalAttrs pattern (#486956)

This commit is contained in:
Pol Dellaiera
2026-02-05 20:44:17 +00:00
committed by GitHub
+9 -9
View File
@@ -7,17 +7,17 @@
ffmpeg,
ttyd,
chromium,
makeWrapper,
makeBinaryWrapper,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "vhs";
version = "0.10.0";
src = fetchFromGitHub {
owner = "charmbracelet";
repo = "vhs";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-ZnE5G8kfj7qScsT+bZg90ze4scpUxeC6xF8dAhdUUCo=";
};
@@ -25,23 +25,23 @@ buildGoModule rec {
nativeBuildInputs = [
installShellFiles
makeWrapper
makeBinaryWrapper
];
ldflags = [
"-s"
"-w"
"-X=main.Version=${version}"
"-X=main.Version=${finalAttrs.version}"
];
postInstall = ''
wrapProgram $out/bin/vhs --prefix PATH : ${
lib.makeBinPath (
lib.optionals stdenv.hostPlatform.isLinux [ chromium ]
++ [
[
ffmpeg
ttyd
]
++ lib.optionals stdenv.hostPlatform.isLinux [ chromium ]
)
}
''
@@ -58,8 +58,8 @@ buildGoModule rec {
description = "Tool for generating terminal GIFs with code";
mainProgram = "vhs";
homepage = "https://github.com/charmbracelet/vhs";
changelog = "https://github.com/charmbracelet/vhs/releases/tag/v${version}";
changelog = "https://github.com/charmbracelet/vhs/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = [ ];
};
}
})