nixos/ollama: override kernelPackages with nvidia driver
Instead of setting linuxPackages to a singleton set with nvidia_x11, override the system's kernelPackages with the nvidia driver. This is more semantically correct, though doesn't change any behavior.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib.types) nullOr enum;
|
||||
inherit (lib) types;
|
||||
|
||||
cfg = config.services.ollama;
|
||||
ollamaPackage = cfg.package.override {
|
||||
inherit (cfg) acceleration;
|
||||
linuxPackages.nvidia_x11 = config.hardware.nvidia.package;
|
||||
linuxPackages = config.boot.kernelPackages.overrideAttrs {
|
||||
nvidia_x11 = config.hardware.nvidia.package;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -15,14 +17,14 @@ in
|
||||
lib.mdDoc "Server for local large language models"
|
||||
);
|
||||
listenAddress = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = types.str;
|
||||
default = "127.0.0.1:11434";
|
||||
description = lib.mdDoc ''
|
||||
Specifies the bind address on which the ollama server HTTP interface listens.
|
||||
'';
|
||||
};
|
||||
acceleration = lib.mkOption {
|
||||
type = nullOr (enum [ "rocm" "cuda" ]);
|
||||
type = types.nullOr (types.enum [ "rocm" "cuda" ]);
|
||||
default = null;
|
||||
example = "rocm";
|
||||
description = lib.mdDoc ''
|
||||
|
||||
Reference in New Issue
Block a user