Skip to content

Commit db7ab71

Browse files
committed
fix(ollama): Broken dataDir convention; Allow ENVs in dataDir
Easy to break the convention, see: #200 double-quotting in shell script prevents globbing: https://www.shellcheck.net/wiki/SC2086
1 parent e7eb9de commit db7ab71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nix/ollama.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ in
3030
};
3131
dataDir = lib.mkOption {
3232
type = types.str;
33-
default = "./data/ollama";
33+
default = "./data/${name}";
3434
description = ''
3535
The directory containing the Ollama models.
3636
Sets the `OLLAMA_MODELS` environment variable.
@@ -93,9 +93,9 @@ in
9393
startScript = pkgs.writeShellApplication {
9494
name = "ollama-server";
9595
text = ''
96-
if [ ! -d ${config.dataDir} ]; then
96+
if [ ! -d "${config.dataDir}" ]; then
9797
echo "Creating directory ${config.dataDir}"
98-
mkdir -p ${config.dataDir}
98+
mkdir -p "${config.dataDir}"
9999
fi
100100
101101
${lib.getExe config.package} serve

0 commit comments

Comments
 (0)