From 47724c5844118aa29b39d2cf5b7d0714695ef64c Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Wed, 5 Feb 2025 22:11:34 +0530 Subject: [PATCH] feat: Added ollama for local machine --- home/linux/gtk.nix | 4 ++-- home/linux/gui.nix | 1 + nixos/mirai/configuration.nix | 8 ++++++++ nixos/ryu/configuration.nix | 11 +++++++++-- nixos/ryu/services/default.nix | 1 + nixos/ryu/services/ollama.nix | 19 +++++++++++++++++++ 6 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 nixos/ryu/services/ollama.nix diff --git a/home/linux/gtk.nix b/home/linux/gtk.nix index df280b07..3f04cc31 100644 --- a/home/linux/gtk.nix +++ b/home/linux/gtk.nix @@ -7,7 +7,7 @@ enable = true; theme = { name = "catppuccin-mocha-mauve-standard+normal"; - package = pkgs.adwaita-icon-theme; + package = pkgs.catppuccinThemes.gtk; # package = pkgs.catppuccin-gtk.override { # variant = "mocha"; # size = "standard"; @@ -33,7 +33,7 @@ gtk4.extraConfig = {gtk-application-prefer-dark-theme = 1;}; }; home.packages = [ - pkgs.catppuccinThemes.gtk + # pkgs.catppuccinThemes.gtk pkgs.catppuccinThemes.papirus-folders ]; } diff --git a/home/linux/gui.nix b/home/linux/gui.nix index c090ee1d..32369d3f 100644 --- a/home/linux/gui.nix +++ b/home/linux/gui.nix @@ -45,5 +45,6 @@ lib.attrsets.optionalAttrs device.hasGui { via wl-clipboard zed-editor + webcord ]; } diff --git a/nixos/mirai/configuration.nix b/nixos/mirai/configuration.nix index feff09ce..a1b30a1c 100644 --- a/nixos/mirai/configuration.nix +++ b/nixos/mirai/configuration.nix @@ -38,6 +38,14 @@ builders-use-substitutes = true secret-key-files = ${config.sops.secrets."builder/mirai/cache/private".path} ''; + substituters = [ + "https://nix-community.cachix.org" + # "https://sh.darksailor.dev" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM=" + ]; gc = { automatic = true; dates = "daily"; diff --git a/nixos/ryu/configuration.nix b/nixos/ryu/configuration.nix index 09d24e18..e4f30a3e 100644 --- a/nixos/ryu/configuration.nix +++ b/nixos/ryu/configuration.nix @@ -52,8 +52,14 @@ auto-optimise-store = true; extra-experimental-features = "nix-command flakes auto-allocate-uids"; trusted-users = ["root" "servius"]; - #substituters = ["https://sh.darksailor.dev"]; - trusted-public-keys = ["mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="]; + substituters = [ + "https://nix-community.cachix.org" + # "https://sh.darksailor.dev" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM=" + ]; }; extraOptions = '' build-users-group = nixbld @@ -246,6 +252,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget systemPackages = with pkgs; [ + nvtopPackages.nvidia quickemu (nixvim.makeNixvim (import ../../neovim)) qpwgraph diff --git a/nixos/ryu/services/default.nix b/nixos/ryu/services/default.nix index 47600c68..afaef29d 100644 --- a/nixos/ryu/services/default.nix +++ b/nixos/ryu/services/default.nix @@ -2,6 +2,7 @@ imports = [ ./samba.nix ./sunshine.nix + ./ollama.nix ]; services = { hardware.openrgb.enable = true; diff --git a/nixos/ryu/services/ollama.nix b/nixos/ryu/services/ollama.nix new file mode 100644 index 00000000..8e652ad4 --- /dev/null +++ b/nixos/ryu/services/ollama.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + services = { + ollama = { + enable = true; + host = "127.0.0.1"; + port = 11434; + package = pkgs.ollama-cuda; + }; + open-webui = { + enable = true; + environment = { + "OLLAMA_API_BASE_URL" = "http://127.0.0.1:11434/api"; + "OLLAMA_BASE_URL" = "http://127.0.0.1:11434"; + WEBUI_AUTH = "False"; + ENABLE_LOGIN_FORM = "False"; + }; + }; + }; +}