diff --git a/hosts/pro-laptop/configuration.nix b/hosts/pro-laptop/configuration.nix index 4a0eec2..72cabc3 100644 --- a/hosts/pro-laptop/configuration.nix +++ b/hosts/pro-laptop/configuration.nix @@ -47,5 +47,9 @@ printing.enable = true; waydroid.enable = true; }; + + server = { + ollama.enable = true; + }; }; } diff --git a/modules/system/server/default.nix b/modules/system/server/default.nix index d75b7fd..84c8c31 100644 --- a/modules/system/server/default.nix +++ b/modules/system/server/default.nix @@ -3,6 +3,7 @@ { imports = [ ./docker + ./ollama ./openssh ]; } \ No newline at end of file diff --git a/modules/system/server/ollama/default.nix b/modules/system/server/ollama/default.nix new file mode 100644 index 0000000..c1bfd7d --- /dev/null +++ b/modules/system/server/ollama/default.nix @@ -0,0 +1,21 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.system.server.ollama; + nvidiaEnabled = config.modules.system.hardware.nvidia.enable; +in +{ + options.modules.system.server.ollama = { + enable = mkEnableOption '' + Enable ollama with my custom configurations + ''; + }; + config = mkIf cfg.enable { + services.ollama = { + enable = true; + + acceleration = if config.modules.system.hardware.nvidia.enable then "cuda" else null; + }; + }; +} \ No newline at end of file