mirror of
https://github.com/juspay/services-flake.git
synced 2024-08-14 14:50:24 +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 {
|
||||
type = types.str;
|
||||
default = "./data/ollama";
|
||||
default = "./data/${name}";
|
||||
description = ''
|
||||
The directory containing the Ollama models.
|
||||
Sets the `OLLAMA_MODELS` environment variable.
|
||||
@ -93,9 +93,9 @@ in
|
||||
startScript = pkgs.writeShellApplication {
|
||||
name = "ollama-server";
|
||||
text = ''
|
||||
if [ ! -d ${config.dataDir} ]; then
|
||||
if [ ! -d "${config.dataDir}" ]; then
|
||||
echo "Creating directory ${config.dataDir}"
|
||||
mkdir -p ${config.dataDir}
|
||||
mkdir -p "${config.dataDir}"
|
||||
fi
|
||||
|
||||
${lib.getExe config.package} serve
|
||||
|
Loading…
Reference in New Issue
Block a user