ollama official service
This commit is contained in:
@@ -27,6 +27,9 @@
|
|||||||
insert = "bar";
|
insert = "bar";
|
||||||
select = "underline";
|
select = "underline";
|
||||||
};
|
};
|
||||||
|
soft-wrap = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
line-number = "relative";
|
line-number = "relative";
|
||||||
color-modes = true;
|
color-modes = true;
|
||||||
bufferline = "always";
|
bufferline = "always";
|
||||||
@@ -44,6 +47,7 @@
|
|||||||
newline = "↴";
|
newline = "↴";
|
||||||
tab = "⇥";
|
tab = "⇥";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
languages.language = [{
|
languages.language = [{
|
||||||
@@ -175,7 +179,7 @@
|
|||||||
};
|
};
|
||||||
"ui.statusline" = {
|
"ui.statusline" = {
|
||||||
"fg" = blue.bright;
|
"fg" = blue.bright;
|
||||||
# "bg" = black.base;
|
"bg" = black.base;
|
||||||
};
|
};
|
||||||
"ui.statusline.inactive" = {
|
"ui.statusline.inactive" = {
|
||||||
"fg" = red.bright;
|
"fg" = red.bright;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, pkgs-unstable, inputs, host, user, nvidia, rice, lib, ... }:
|
{ pkgs, pkgs-unstable, inputs, host, user, nvidia, rice, lib, ... }:
|
||||||
let
|
let
|
||||||
animation-speed = "2";
|
animation-speed = "2";
|
||||||
transparency = builtins.toString rice.transparency;
|
transparency = builtins.toString rice.transparency;
|
||||||
|
|||||||
@@ -1,43 +1,51 @@
|
|||||||
{ config, pkgs, lib, system, user, host, allowed, secrets, ... }:
|
{ pkgs, lib, host, nvidia, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
ollama
|
ollama
|
||||||
];
|
];
|
||||||
|
|
||||||
services.ollama.environmentVariables = {
|
# services.ollama.environmentVariables = {
|
||||||
OLLAMA_ORIGINS = "*";
|
# OLLAMA_ORIGINS = "*";
|
||||||
};
|
# };
|
||||||
|
|
||||||
systemd.services.ollama = {
|
# systemd.services.ollama = {
|
||||||
environment.OLLAMA_ORIGINS = "*";
|
# environment.OLLAMA_ORIGINS = "*";
|
||||||
description = "Ollama Service";
|
# description = "Ollama Service";
|
||||||
after = [ "network-online.target" "ollama-doesnt-respect-xdg-data-home.service" ];
|
# after = [ "network-online.target" "ollama-doesnt-respect-xdg-data-home.service" ];
|
||||||
serviceConfig = {
|
# serviceConfig = {
|
||||||
Type = "simple";
|
# Type = "simple";
|
||||||
# Environment = "\"XDG_DATA_HOME=/run/current-system/sw/share\"";
|
# # Environment = "\"XDG_DATA_HOME=/run/current-system/sw/share\"";
|
||||||
ExecStart = "${pkgs.ollama}/bin/ollama serve";
|
# ExecStart = "${pkgs.ollama}/bin/ollama serve";
|
||||||
User = "ollama";
|
# User = "ollama";
|
||||||
Group = "ollama";
|
# Group = "ollama";
|
||||||
Restart = "always";
|
# Restart = "always";
|
||||||
RestartSec = "3";
|
# RestartSec = "3";
|
||||||
|
# };
|
||||||
|
# wantedBy = [ "default.target" ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# users.users.ollama = {
|
||||||
|
# isSystemUser = true;
|
||||||
|
# home = "/usr/share/ollama";
|
||||||
|
# shell = "/bin/false";
|
||||||
|
# group = "ollama";
|
||||||
|
# };
|
||||||
|
# users.groups.ollama = {};
|
||||||
|
|
||||||
|
# systemd.services.ollama-doesnt-respect-xdg-data-home = {
|
||||||
|
# wantedBy = ["multi-user.target"];
|
||||||
|
# script = ''
|
||||||
|
# mkdir -p /usr/share/ollama/.ollama
|
||||||
|
# chown ollama:ollama -R /usr/share/ollama
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
|
services.ollama = {
|
||||||
|
enable = true;
|
||||||
|
acceleration = lib.mkIf nvidia.enable "cuda";
|
||||||
|
listenAddress = if host == "NxACE" then "0.0.0.0:11434" else "127.0.0.1:11434";
|
||||||
|
environmentVariables = {
|
||||||
|
OLLAMA_ORIGINS = "*";
|
||||||
};
|
};
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.ollama = {
|
|
||||||
isSystemUser = true;
|
|
||||||
home = "/usr/share/ollama";
|
|
||||||
shell = "/bin/false";
|
|
||||||
group = "ollama";
|
|
||||||
};
|
|
||||||
users.groups.ollama = {};
|
|
||||||
|
|
||||||
systemd.services.ollama-doesnt-respect-xdg-data-home = {
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
script = ''
|
|
||||||
mkdir -p /usr/share/ollama/.ollama
|
|
||||||
chown ollama:ollama -R /usr/share/ollama
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user