mirror of
https://github.com/juspay/services-flake.git
synced 2024-09-11 04:15:36 +03:00
fix(ollama): Broken dataDir
convention; Allow ENVs in dataDir
Easy to break the convention, see: https://github.com/juspay/services-flake/issues/200 double-quotting in shell script prevents globbing: https://www.shellcheck.net/wiki/SC2086
This commit is contained in:
parent
e7eb9dec41
commit
db7ab711d9
@ -30,7 +30,7 @@ in
|
|||||||
};
|
};
|
||||||
dataDir = lib.mkOption {
|
dataDir = lib.mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "./data/ollama";
|
default = "./data/${name}";
|
||||||
description = ''
|
description = ''
|
||||||
The directory containing the Ollama models.
|
The directory containing the Ollama models.
|
||||||
Sets the `OLLAMA_MODELS` environment variable.
|
Sets the `OLLAMA_MODELS` environment variable.
|
||||||
@ -93,9 +93,9 @@ in
|
|||||||
startScript = pkgs.writeShellApplication {
|
startScript = pkgs.writeShellApplication {
|
||||||
name = "ollama-server";
|
name = "ollama-server";
|
||||||
text = ''
|
text = ''
|
||||||
if [ ! -d ${config.dataDir} ]; then
|
if [ ! -d "${config.dataDir}" ]; then
|
||||||
echo "Creating directory ${config.dataDir}"
|
echo "Creating directory ${config.dataDir}"
|
||||||
mkdir -p ${config.dataDir}
|
mkdir -p "${config.dataDir}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${lib.getExe config.package} serve
|
${lib.getExe config.package} serve
|
||||||
|
Loading…
Reference in New Issue
Block a user