Skip to content

Commit

Permalink
[24.05] nixos/ollama: make overrides compatible with unstable package
Browse files Browse the repository at this point in the history
The unstable package no longer uses `linuxPackages` for nvidia/cuda,
so when `services.ollama.package = unstable.ollama;` is set,
the unstable package is overridden with `linuxPackages` causing a build failure.
  • Loading branch information
abysssol committed Jul 10, 2024
1 parent 110fd8d commit f95457b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nixos/modules/services/misc/ollama.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ let
inherit (lib) types;

cfg = config.services.ollama;
ollamaPackage = cfg.package.override {

ollamaPackage = cfg.package.override (prevArgs: {
inherit (cfg) acceleration;
} // lib.optionalAttrs (prevArgs ? linuxPackages) {
linuxPackages = config.boot.kernelPackages // {
nvidia_x11 = config.hardware.nvidia.package;
};
};
});
in
{
options = {
Expand Down

0 comments on commit f95457b

Please sign in to comment.