mirror of
https://github.com/Alexandre1a/NixOSDots.git
synced 2026-03-10 00:09:46 +01:00
Fixed ollama package
This commit is contained in:
parent
7e7ea34ca6
commit
cc588a1947
@ -1,6 +1,8 @@
|
||||
{ pkgs ,... }:
|
||||
|
||||
{
|
||||
# Enpty file for future imports
|
||||
imports = [
|
||||
(import ../../common/ai.nix { gpu = "metal"; })
|
||||
(import ../../common/ai.nix { inherit pkgs; })
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
{ pkgs ,... }:
|
||||
|
||||
{
|
||||
# This file is used to import all modules required by this setup.
|
||||
imports =
|
||||
@ -8,6 +10,6 @@
|
||||
../../modules/nixos/gamming/steam.nix # For Steam/Proton/Lutris/MangoHUD/Heroic/Bottles
|
||||
../../modules/common/spotify.nix # Spotify/Spicetify
|
||||
../../modules/common/ssh.nix
|
||||
(import ../../modules/common/ai.nix { gpu = "cuda"; })
|
||||
(import ../../modules/common/ai.nix { inherit pkgs; })
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,11 +1,23 @@
|
||||
{ gpu, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
# Détection simple du GPU pour choisir le package Ollama
|
||||
gpu =
|
||||
if builtins.hasAttr "nvidia" pkgs then
|
||||
pkgs.ollama-cuda
|
||||
else if builtins.hasAttr "vulkan" pkgs then
|
||||
pkgs.ollama-vulkan
|
||||
else if builtins.hasAttr "rocm" pkgs then
|
||||
pkgs.ollama-rocm
|
||||
else
|
||||
pkgs.ollama; # CPU fallback
|
||||
in
|
||||
{
|
||||
services = {
|
||||
ollama = {
|
||||
enable = true;
|
||||
loadModels = [ "codegemma:7b-instruct" "codegemma:7b-code" "codegemma:2b" "starcoder2:7b" ];
|
||||
acceleration = gpu;
|
||||
package = gpu;
|
||||
};
|
||||
open-webui = {
|
||||
enable = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user