Skip to content

fix(nix flake): ensure nix flake builds successfully - #10399

Merged
mudler merged 5 commits into
mudler:masterfrom
Souheab:fix/nix-flake-not-building
Jun 19, 2026
Merged

fix(nix flake): ensure nix flake builds successfully#10399
mudler merged 5 commits into
mudler:masterfrom
Souheab:fix/nix-flake-not-building

Conversation

@Souheab

@Souheab Souheab commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes the issue of nix flake not building, and additionally also fixes a NixOS specific bug where in the backends folder when running scripts like run.sh (which is present in the cuda12-llama-cpp backend)

Notes for Reviewers
There were many reasons the flake was not building.

First inference_defaults.json was being fetched from unsloth by the flake and this caused a hash mismatch. I noticed that inference_defaults.json was already present in the repository and was regularly updated via github actions so I thought it was unecessary to fetch it via the flake and instead the inference_defaults.json that already exists in the repo can be used.

There was a hash mismatch for the Go vendorHash so I updated that with the correct hash.

The Go makefile required "core/http/react-ui/dist" to exist so I added a nix derivation for the react UI.

After this it was able to build successfully but some backends such as the "cuda12-llama-cpp" backend weren't working and there was an error running run.sh in this backend as they used the "#!/bin/bash" shebang and /bin/bash isn't present on NixOS due to it not following the Filesystem Hierarchy Standard (FHS). I fixed this by adding an FHS environment wrapper with bash, grep and coreutils to ensure that the script is able to run correctly.

To avoid hash mismatches in the future, I think it might be a good idea to have GitHub actions automatically update the vendorHash for the flake whenever go.mod or go.sum is updated

Signed commits

  • Yes, I signed my commits.

Souheab added 5 commits June 19, 2026 01:03
there are inference_defaults.json already in the repo so we can use
those, they are regularly updated with github actions, and we avoid hash
mismatch errors in the flake this way

Signed-off-by: Souheab <souheab@protonmail.com>
Signed-off-by: Souheab <souheab@protonmail.com>
Signed-off-by: Souheab <souheab@protonmail.com>
Signed-off-by: Souheab <souheab@protonmail.com>
… npmDepsHash

Signed-off-by: Souheab <souheab@protonmail.com>
@Souheab
Souheab force-pushed the fix/nix-flake-not-building branch from 7c91c9d to d8f968c Compare June 19, 2026 05:03
@mudler
mudler requested a review from richiejp June 19, 2026 12:47
@mudler

mudler commented Jun 19, 2026

Copy link
Copy Markdown
Owner

I don't use nix, @richiejp probably can help reviewing here

@richiejp

Copy link
Copy Markdown
Collaborator

Awesome stuff, I only use the dev env so far. So yeah we need a ci job to update the vendor hash otherwise it'll bitrot very quickly

@mudler
mudler merged commit 59c7ad5 into mudler:master Jun 19, 2026
1 check passed
@localai-bot localai-bot added the bug Something isn't working label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants