From 543bf1dd3baf26dbea5b83545c675c52b90e16cd Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 7 Nov 2024 15:19:21 -0600 Subject: [PATCH] better isolate llm --- modules/llm/default.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/llm/default.nix b/modules/llm/default.nix index 16979a3..b0175e9 100644 --- a/modules/llm/default.nix +++ b/modules/llm/default.nix @@ -6,14 +6,20 @@ ... }: +let + selfPackages = (flake.pkgs "self"); + pyWithLlm = ( + pkgs.python3.withPackages (_: [ + selfPackages.llm + selfPackages.llm-claude-3 + ]) + ); + llm-with-plugins = ( + pkgs.writeShellScriptBin "llm" '' + exec ${pyWithLlm}/bin/llm "$@" + '' + ); +in mkOizysModule config "llm" { - environment.systemPackages = with pkgs; [ - (python3.withPackages (ps: - with (flake.pkgs "self"); - [ - llm - llm-claude-3 - ] - )) - ]; + environment.systemPackages = [ llm-with-plugins ]; }