feat(ollama): add ollama service
This commit is contained in:
parent
c16d189164
commit
f47962d025
25
users/modules/ollama.nix
Normal file
25
users/modules/ollama.nix
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.modules.ollama;
|
||||||
|
in {
|
||||||
|
options.modules.ollama = {
|
||||||
|
enable = mkEnableOption "Enables Ollama";
|
||||||
|
gpu = mkOption {
|
||||||
|
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
||||||
|
example = "amd";
|
||||||
|
default = "none";
|
||||||
|
description = "Which type of GPU should be used for hardware acceleration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.services.ollama = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
environmentVariables = {
|
||||||
|
OLLAMA_CONTEXT_LENGTH = "8192";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -9,16 +9,17 @@
|
|||||||
./packages.nix
|
./packages.nix
|
||||||
./email.nix
|
./email.nix
|
||||||
../modules/emacs.nix
|
../modules/emacs.nix
|
||||||
|
../modules/emoji.nix
|
||||||
|
../modules/hyprland.nix
|
||||||
../modules/kdeconnect.nix
|
../modules/kdeconnect.nix
|
||||||
../modules/kitty.nix
|
../modules/kitty.nix
|
||||||
../modules/hyprland.nix
|
|
||||||
../modules/mbsync.nix
|
../modules/mbsync.nix
|
||||||
../modules/mpd.nix
|
../modules/mpd.nix
|
||||||
../modules/mpv.nix
|
../modules/mpv.nix
|
||||||
|
../modules/ollama.nix
|
||||||
|
../modules/qt.nix
|
||||||
../modules/wofi.nix
|
../modules/wofi.nix
|
||||||
../modules/yt-dlp.nix
|
../modules/yt-dlp.nix
|
||||||
../modules/emoji.nix
|
|
||||||
../modules/qt.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
@ -55,6 +56,7 @@
|
|||||||
bat.extras = true;
|
bat.extras = true;
|
||||||
packages.emacsPackage = emacsPkg;
|
packages.emacsPackage = emacsPkg;
|
||||||
mopidy.enable = true;
|
mopidy.enable = true;
|
||||||
|
ollama.enable = true;
|
||||||
|
|
||||||
emacs = {
|
emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user