chore: update llama-swap

This commit is contained in:
2026-04-06 16:08:23 -04:00
parent d5942d9fb0
commit a62ffc0089
2 changed files with 22 additions and 7 deletions

View File

@@ -5,6 +5,7 @@
, versionCheckHook
, callPackage
, nixosTests
, nix-update-script
,
}:
@@ -13,13 +14,18 @@ let
in
buildGoModule (finalAttrs: {
pname = "llama-swap";
version = "197";
version = "199";
outputs = [
"out"
"wol" # wake on lan proxy
];
src = fetchFromGitHub {
owner = "mostlygeek";
repo = "llama-swap";
tag = "v${finalAttrs.version}";
hash = "sha256-EXgyYmpbN/zzr6KeSpvFEB+FS7gDIZFinNMv70v5boY=";
hash = "sha256-tAWXhfOWPLBuEgd+32CbuIkn1hN+4VI4xkyx7E2a81I=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
@@ -35,7 +41,6 @@ buildGoModule (finalAttrs: {
vendorHash = "sha256-XiDYlw/byu8CWvg4KSPC7m8PGCZXtp08Y1velx4BR8U=";
passthru.ui = callPackage ./ui.nix { llama-swap = finalAttrs.finalPackage; };
passthru.npmDepsHash = "sha256-Fs7+JKE8YBp2Xj8bVBlwmT+UwuD642VeUHiPx+fv94c=";
nativeBuildInputs = [
versionCheckHook
@@ -73,8 +78,8 @@ buildGoModule (finalAttrs: {
checkFlags =
let
skippedTests = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Fail only on x86_64-darwin intermittently
skippedTests = lib.optionals (stdenv.isDarwin) [
# Fail only on *-darwin intermittently
# https://github.com/mostlygeek/llama-swap/issues/320
"TestProcess_AutomaticallyStartsUpstream"
"TestProcess_WaitOnMultipleStarts"
@@ -90,6 +95,7 @@ buildGoModule (finalAttrs: {
"TestProcess_ForceStopWithKill"
"TestProcess_StopCmd"
"TestProcess_EnvironmentSetCorrectly"
"TestProcess_ReverseProxyPanicIsHandled"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
@@ -105,14 +111,22 @@ buildGoModule (finalAttrs: {
rm "$GOPATH/bin/simple-responder"
'';
preInstall = ''
postInstall = ''
install -Dm444 -t "$out/share/llama-swap" config.example.yaml
mkdir -p "$wol/bin"
mv "$out/bin/wol-proxy" "$wol/bin/"
'';
doInstallCheck = true;
versionCheckProgramArg = "-version";
passthru.tests.nixos = nixosTests.llama-swap;
passthru.updateScript = nix-update-script {
extraArgs = [
"--subpackage"
"ui"
];
};
meta = {
homepage = "https://github.com/mostlygeek/llama-swap";