summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/bean/common.nix7
-rw-r--r--hosts/tomato/default.nix2
-rw-r--r--hosts/tomato/packages.nix10
-rw-r--r--modules/default.nix1
-rw-r--r--modules/ollama.nix26
5 files changed, 30 insertions, 16 deletions
diff --git a/hosts/bean/common.nix b/hosts/bean/common.nix
index ef7ec36..5785ac9 100644
--- a/hosts/bean/common.nix
+++ b/hosts/bean/common.nix
@@ -79,12 +79,7 @@ in
"xdg/gtk-3.0/settings.ini".source = ./gtkrc-3.ini;
};
- services.ollama = {
- enable = true;
- environmentVariables = {
- OLLAMA_CONTEXT_LENGTH = "8192";
- };
- };
+ this.ollama.enable = true;
services.joycond.enable = true;
diff --git a/hosts/tomato/default.nix b/hosts/tomato/default.nix
index d80afa2..b2b3e8a 100644
--- a/hosts/tomato/default.nix
+++ b/hosts/tomato/default.nix
@@ -28,6 +28,8 @@
services.joycond.enable = true;
+ this.ollama.enable = true;
+
this.buildMachines = ["pinto"];
this.apache = {
diff --git a/hosts/tomato/packages.nix b/hosts/tomato/packages.nix
index 5135f7e..5c17218 100644
--- a/hosts/tomato/packages.nix
+++ b/hosts/tomato/packages.nix
@@ -3,8 +3,6 @@
let
blender-bin = inputs.blender-bin.
packages.x86_64-linux;
- nixpkgs-unstable = inputs.nixpkgs-unstable.
- legacyPackages.x86_64-linux;
in
{
this.sets = {
@@ -72,14 +70,6 @@ in
virtualisation.waydroid.enable = true;
programs.adb.enable = true;
- services.ollama = {
- enable = true;
- package = nixpkgs-unstable.ollama;
- environmentVariables = {
- OLLAMA_CONTEXT_LENGTH = "8192";
- };
- };
-
this.unfree.allowed = [
"shipwright"
"2ship2harkinian"
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";
+ };
+ };
+ };
+}