diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/default.nix | 1 | ||||
-rw-r--r-- | modules/ollama.nix | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/modules/default.nix b/modules/default.nix index fb09c0b..4baf4b7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -15,6 +15,7 @@ ./bluetooth.nix ./unfree.nix ./build-machines.nix + ./ollama.nix ./apache ./overlays ]; diff --git a/modules/ollama.nix b/modules/ollama.nix new file mode 100644 index 0000000..7bbcfd1 --- /dev/null +++ b/modules/ollama.nix @@ -0,0 +1,26 @@ +{ lib, pkgs, config, inputs, ... }: + +let + nixpkgs-unstable = inputs.nixpkgs-unstable. + legacyPackages.x86_64-linux; + cfg = config.this.ollama; +in +{ + options = { + this.ollama = { + enable = lib.mkEnableOption "ollama"; + unstable = lib.mkEnableOption "unstable ollama package" + // { default = true; }; + }; + }; + + config = lib.mkIf cfg.enable { + services.ollama = { + enable = true; + package = lib.mkIf cfg.unstable nixpkgs-unstable.ollama; + environmentVariables = { + OLLAMA_CONTEXT_LENGTH = "8192"; + }; + }; + }; +} |