ollama working with real /usr/share
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# your system. Help is available in the configuration.nix(5) man page, on
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ config, lib, pkgs, allowed, secrets, ... }:
|
||||
{ config, lib, pkgs, user, allowed, secrets, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
@@ -166,17 +166,19 @@
|
||||
### OLLAMA
|
||||
systemd.services.ollama = {
|
||||
description = "Ollama Service";
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig.Type = "simple";
|
||||
serviceConfig.ExecStart = "${pkgs.ollama} serve";
|
||||
serviceConfig.User = "ollama";
|
||||
serviceConfig.Group = "ollama";
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "3";
|
||||
after = [ "network-online.target" "ollama-doesnt-respect-xdg-data-home.service" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
# Environment = "\"XDG_DATA_HOME=/run/current-system/sw/share\"";
|
||||
ExecStart = "${pkgs.ollama}/bin/ollama serve";
|
||||
User = "ollama";
|
||||
Group = "ollama";
|
||||
Restart = "always";
|
||||
RestartSec = "3";
|
||||
};
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
|
||||
users.users.ollama = {
|
||||
isSystemUser = true;
|
||||
home = "/usr/share/ollama";
|
||||
@@ -184,6 +186,15 @@
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
### END OLLAMA
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user