diff options
Diffstat (limited to 'shell.nix')
| -rw-r--r-- | shell.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..db2f403 --- /dev/null +++ b/shell.nix @@ -0,0 +1,48 @@ +{ pkgs ? import sources.nixpkgs { } +, sources ? import ./npins +}: + +with pkgs; + +let + + python = + python312.withPackages (pythonPkgs: [ + ]); + + pull = writeShellApplication { + name = "pull"; + text = '' + ollama pull gemma3 + ollama pull llama3.1:8b + ''; + }; + + serve = writeShellApplication { + name = "serve"; + text = '' + ollama serve + ''; + }; + +in + +mkShell { + packages = [ + ollama + pull + python + serve + ]; + shellHook = '' + if [ ! -d .venv ]; then + python -m venv .venv + source .venv/bin/activate + pip install --upgrade uv + else + source .venv/bin/activate + fi + + uv sync + ''; +} |
