llama-swap: 216 -> 224

Release notes: https://github.com/mostlygeek/llama-swap/releases

Additional changes:

1. One of the tests now creates a bash script, so we need to fix said
bash script's shebang.
2. The embedded UI has moved.
This commit is contained in:
Steven Allen 2026-06-10 22:21:30 -07:00
commit c8fec47e78
2 changed files with 13 additions and 6 deletions

View file

@ -8,6 +8,8 @@
callPackage,
bash,
nixosTests,
nix-update-script,
}:
@ -17,7 +19,7 @@ let
in
buildGoModule (finalAttrs: {
pname = "llama-swap";
version = "216";
version = "224";
outputs = [
"out"
@ -28,7 +30,7 @@ buildGoModule (finalAttrs: {
owner = "mostlygeek";
repo = "llama-swap";
tag = "v${finalAttrs.version}";
hash = "sha256-PHSY4z2h406xL+EcIYyrzr4s28txO7SCsWm8hrXf+2U=";
hash = "sha256-IblAaM9FBdI2Y9rg36SWpclQ0jV6Y93RC+N+cXWEO94=";
# 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;
@ -41,7 +43,7 @@ buildGoModule (finalAttrs: {
'';
};
vendorHash = "sha256-QysQ7YdwJcLTziwL25j73n3tQVvzVQIFxN4GkTU8JZg=";
vendorHash = "sha256-b+RreafBMCWT/jbWTlXaiDRzA4DRe76WaCEbrfRxV/4=";
passthru.ui = callPackage ./ui.nix { llama-swap = finalAttrs.finalPackage; };
@ -58,13 +60,18 @@ buildGoModule (finalAttrs: {
"-X main.version=${finalAttrs.version}"
];
postPatch = ''
substituteInPlace internal/process/process_command_forking_test.go \
--replace "#!/bin/bash" "#!${lib.getExe bash}"
'';
preBuild = ''
# ldflags based on metadata from git and source
ldflags+=" -X main.commit=$(cat COMMIT)"
ldflags+=" -X main.date=$(cat SOURCE_DATE_EPOCH)"
# copy for go:embed in proxy/ui_embed.go
cp -r ${finalAttrs.passthru.ui}/ui_dist proxy/
# copy for go:embed in internal/server/ui_embed.go
cp -r ${finalAttrs.passthru.ui}/ui_dist internal/server/
'';
excludedPackages = [

View file

@ -11,7 +11,7 @@ buildNpmPackage (finalAttrs: {
postPatch = ''
substituteInPlace vite.config.ts \
--replace-fail "../proxy/ui_dist" "${placeholder "out"}/ui_dist"
--replace-fail "../internal/server/ui_dist" "${placeholder "out"}/ui_dist"
'';
sourceRoot = "${finalAttrs.src.name}/ui-svelte";