From 11ada7d35df97f6108ca099c5b9acbe7086828eb Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 24 Jul 2025 07:29:43 +0000 Subject: [PATCH] alpaca: ship on moby; fix cross --- hosts/common/programs/alpaca.nix | 24 +++++++++++++++++++++++- hosts/common/programs/assorted.nix | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hosts/common/programs/alpaca.nix b/hosts/common/programs/alpaca.nix index 381f4666a..793f5ec64 100644 --- a/hosts/common/programs/alpaca.nix +++ b/hosts/common/programs/alpaca.nix @@ -1,14 +1,36 @@ # alpaca: ollama llm client # - super simple, easy UI +# +# shortcomings (as of 6.1.7, 2025-07-23): # - doesn't seem to do any prompt tuning; # inherits all the pathologies of the underlying model (e.g. makes up citations) # # it creates a config dir, `~/.config/com.jeffser.Alpaca`, but apparently empty # # TODO: configure ollama connection details statically -{ ... }: +# TODO: update the nix package 6.1.7 -> 7.5.2 +# - i.e. review +{ pkgs, ... }: { sane.programs.alpaca = { + packageUnwrapped = (pkgs.alpaca.override { + # ollama is only added to `PATH`; since i'm using it via http, remove it here. + # fixes cross compilation & simplifies closure. + ollama = null; + python3Packages = pkgs.python3Packages // { + # XXX(2025-07-23): does not cross compile (markitdown -> pydub -> ... -> opencv) + markitdown = null; + }; + }).overrideAttrs (upstream: { + postPatch = (upstream.postPatch or "") + '' + # for nulled dependencies (above), patch so the application only errors + # at runtime, on first attempted use. + substituteInPlace src/widgets/attachments.py \ + --replace-fail 'from markitdown' '# from markitdown' + ''; + }); + buildCost = 2; #< liable to break cross during updates; not important enough to block deploy over + sandbox.net = "all"; # maybe only needs wireguard, actually sandbox.whitelistWayland = true; sandbox.mesaCacheDir = ".cache/com.jeffser.Alpaca/mesa"; diff --git a/hosts/common/programs/assorted.nix b/hosts/common/programs/assorted.nix index 5646312fd..dd521caa9 100644 --- a/hosts/common/programs/assorted.nix +++ b/hosts/common/programs/assorted.nix @@ -303,6 +303,7 @@ in guiBaseApps = declPackageSet [ # "abaddon" # discord client "alacritty" # terminal emulator + "alpaca" # ollama/LLM client "blanket" # ambient noise generator "calls" # gnome calls (dialer/handler) "confy" # conference planning app @@ -402,7 +403,6 @@ in "pcGameApps" "pcTuiApps" #### - "alpaca" # ollama/LLM client "audacity" "brave" # for the integrated wallet -- as a backup # "cantata" # music player (mpd frontend)