mirror of
https://github.com/adrlau/nix-dotfiles.git
synced 2026-03-06 17:42:06 +01:00
aragon ollama niri
This commit is contained in:
@@ -194,6 +194,8 @@ layout {
|
||||
// Offset moves the shadow relative to the window.
|
||||
offset x=0 y=5
|
||||
|
||||
|
||||
|
||||
// You can also change the shadow color and opacity.
|
||||
color "#0007"
|
||||
}
|
||||
@@ -343,6 +345,8 @@ binds {
|
||||
Mod+Return { spawn "foot"; }
|
||||
Mod+D { spawn "fuzzel"; }
|
||||
Super+M { spawn "swaylock"; }
|
||||
|
||||
Mod+Escape { toggle-keyboard-shortcuts-inhibit; } //for diabling niri shortcuts for a while.
|
||||
|
||||
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
||||
// Note: the entire command goes as a single argument in the end.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#customised applications
|
||||
../../services/podman.nix
|
||||
../../services/boinc.nix
|
||||
../../services/ollama.nix
|
||||
../../services/ollama-amd.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
|
||||
@@ -13,7 +13,15 @@
|
||||
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
hardware.amdgpu.opencl.enable = true;
|
||||
hardware.amdgpu.amdvlk.enable = true;
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
|
||||
@@ -21,11 +29,30 @@
|
||||
|
||||
nixpkgs.config.rocmSupport = true;
|
||||
|
||||
environment.variables = {
|
||||
HSA_OVERRIDE_GFX_VERSION="10.3.0";
|
||||
|
||||
};
|
||||
|
||||
|
||||
#hardware.opengl.extraPackages32 = with pkgs; [
|
||||
# driversi686Linux.amdvlk
|
||||
#];
|
||||
|
||||
environment.systemPackages = with pkgs; [ lact ];
|
||||
environment.systemPackages = with pkgs; [
|
||||
lact
|
||||
rocmPackages.rocminfo
|
||||
rocmPackages.rocm-smi
|
||||
rocmPackages.rocm-runtime
|
||||
rocmPackages.rocm-device-libs
|
||||
rocmPackages.rocm-core
|
||||
rocmPackages.rocm-cmake
|
||||
rocmPackages.rocgdb
|
||||
rocmPackages.rocblas
|
||||
rocmPackages.rccl
|
||||
|
||||
|
||||
];
|
||||
systemd.packages = with pkgs; [ lact ];
|
||||
systemd.services.lactd.wantedBy = ["multi-user.target"];
|
||||
|
||||
|
||||
54
services/ollama-amd.nix
Normal file
54
services/ollama-amd.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Add Ollama to system packages
|
||||
environment.systemPackages = [ pkgs.unstable.ollama ];
|
||||
|
||||
# Ollama configuration
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.ollama;
|
||||
host = "0.0.0.0";
|
||||
openFirewall = true;
|
||||
port = 11434;
|
||||
home = "/var/lib/ollama";
|
||||
|
||||
# Preloaded models
|
||||
loadModels = [
|
||||
"gemma3:1b"
|
||||
"qwen3:8b"
|
||||
"qwen3:0.6b"
|
||||
"llama3.1"
|
||||
"moondream"
|
||||
"minicpm-v"
|
||||
"qwen2.5vl:3b"
|
||||
"gemma3:4b"
|
||||
"granite3.2-vision"
|
||||
"zylonai/multilingual-e5-large"
|
||||
"nomic-embed-text"
|
||||
"snowflake-arctic-embed2"
|
||||
];
|
||||
|
||||
# Environment variables based on hostname
|
||||
environmentVariables = {
|
||||
"HIP_VISIBLE_DEVICES" = "0,1";
|
||||
"OLLAMA_LLM_LIBRARY" = "rocm";
|
||||
};
|
||||
|
||||
rocmOverrideGfx = "10.3.0"; #rdna2
|
||||
|
||||
# Acceleration settings
|
||||
acceleration = "rocm";
|
||||
|
||||
};
|
||||
|
||||
# NGINX reverse proxy configuration
|
||||
services.nginx.virtualHosts."ollama.${config.networking.hostName}.${config.networking.domain}" = {
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://${config.services.ollama.listenAddress}";
|
||||
};
|
||||
basicAuthFile = config.sops.secrets."nginx/defaultpass".path;
|
||||
};
|
||||
}
|
||||
@@ -1,52 +1,48 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
hostname = config.networking.hostName;
|
||||
in
|
||||
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.unstable.ollama
|
||||
];
|
||||
# Add Ollama to system packages
|
||||
environment.systemPackages = [ pkgs.unstable.ollama ];
|
||||
|
||||
# Ollama configuration
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.ollama;
|
||||
host = "0.0.0.0";
|
||||
openFirewall = true;
|
||||
port = 11434;
|
||||
home = "/var/lib/ollama";
|
||||
enable = true;
|
||||
package = pkgs.unstable.ollama;
|
||||
host = "0.0.0.0";
|
||||
openFirewall = true;
|
||||
port = 11434;
|
||||
home = "/var/lib/ollama";
|
||||
|
||||
loadModels = [
|
||||
"gemma3:1b"
|
||||
"qwen3:8b"
|
||||
"qwen3:0.6b"
|
||||
"llama3.1"
|
||||
# Preloaded models
|
||||
loadModels = [
|
||||
"gemma3:1b"
|
||||
"qwen3:8b"
|
||||
"qwen3:0.6b"
|
||||
"llama3.1"
|
||||
"moondream"
|
||||
"minicpm-v"
|
||||
"qwen2.5vl:3b"
|
||||
"gemma3:4b"
|
||||
"granite3.2-vision"
|
||||
"zylonai/multilingual-e5-large"
|
||||
"nomic-embed-text"
|
||||
"snowflake-arctic-embed2"
|
||||
];
|
||||
|
||||
"moondream"
|
||||
"minicpm-v"
|
||||
"qwen2.5vl:3b"
|
||||
"gemma3:4b"
|
||||
"granite3.2-vision"
|
||||
# Acceleration settings
|
||||
acceleration = "cuda";
|
||||
|
||||
|
||||
"zylonai/multilingual-e5-large"
|
||||
"nomic-embed-text"
|
||||
"snowflake-arctic-embed2"
|
||||
|
||||
];
|
||||
};
|
||||
|
||||
#possibly a flawed idea, should just set cudaSupport and rocm support.
|
||||
services.ollama.acceleration = lib.mkDefault ( let
|
||||
hostname = config.networking.hostName;
|
||||
in
|
||||
if hostname == "galadriel" then "cuda"
|
||||
else if hostname == "aragorn" then "rocm"
|
||||
else null);
|
||||
|
||||
# NGINX reverse proxy configuration
|
||||
services.nginx.virtualHosts."ollama.${config.networking.hostName}.${config.networking.domain}" = {
|
||||
forceSSL = true;
|
||||
#useACMEHost = config.networking.domain; #not sure if this will work, unless
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://${config.services.ollama.listenAddress}";
|
||||
};
|
||||
basicAuthFile = config.sops.secrets."nginx/defaultpass".path;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://${config.services.ollama.listenAddress}";
|
||||
};
|
||||
basicAuthFile = config.sops.secrets."nginx/defaultpass".path;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user