openshell: 0.0.22 -> 0.0.23

This commit is contained in:
m3tm3re
2026-04-06 18:23:44 +02:00
parent b65bbcacbe
commit 19332ebb74
7 changed files with 515 additions and 25 deletions

View File

@@ -6,38 +6,66 @@
nodePackages,
uv,
python3,
makeWrapper,
nix-update-script,
}: let
pname = "eigent";
version = "0.0.89";
src = fetchurl {
url = "https://github.com/eigent-ai/eigent/releases/download/v${version}/Eigent-${version}.AppImage";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
hash = "sha256-9KuiFjegfXhCu1W/FCinWX4ae/DsNPudeBcXFfW18Hc=";
};
appimageContents = appimageTools.extractType2 {inherit pname version src;};
in
appimageTools.wrapType2 {
inherit pname version src;
nativeBuildInputs = [makeWrapper];
extraPkgs = pkgs: [
extraPkgs = _: [
nodejs
nodePackages.npm
uv
python3
];
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/Eigent.desktop -t $out/share/applications
substituteInPlace $out/share/applications/Eigent.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
install -m 444 -D ${appimageContents}/Eigent.png \
$out/share/icons/hicolor/256x256/apps/Eigent.png
wrapProgram $out/bin/${pname} \
--prefix PATH : ${lib.makeBinPath [nodejs nodePackages.npm uv python3]}
# Runs before bubblewrap launches — sets up writable state for the sandbox.
extraPreBwrapCmds = ''
# eigent writes to multiple dirs under resources/ at runtime:
# prebuilt/ pyvenv.cfg, .terminal_venv_fixed sentinel
# backend/ creates runtime/ dir for temporary state
# Nix store is read-only EROFS. Copy to writable location on first
# launch (or when the package version changes).
DATA_DIR="$HOME/.local/share/${pname}"
mkdir -p "$DATA_DIR"
for subdir in prebuilt backend; do
SRC="${appimageContents}/resources/$subdir"
DST="$DATA_DIR/$subdir"
if [ ! -f "$DST/.nix-src" ] || [ "$(cat "$DST/.nix-src")" != "${appimageContents}" ]; then
rm -rf "$DST"
cp -r "$SRC" "$DST"
chmod -R u+w "$DST"
echo "${appimageContents}" > "$DST/.nix-src"
fi
done
'';
# Bind-mount writable copies over the read-only store paths so the app
# sees its files at the expected locations but can write to them.
extraBwrapArgs = [
"--bind $HOME/.local/share/${pname}/prebuilt ${appimageContents}/resources/prebuilt"
"--bind $HOME/.local/share/${pname}/backend ${appimageContents}/resources/backend"
];
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/eigent.desktop -t $out/share/applications
substituteInPlace $out/share/applications/eigent.desktop \
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=${pname} %U'
install -m 444 -D ${appimageContents}/eigent.png \
$out/share/icons/hicolor/256x256/apps/eigent.png
'';
passthru = {
updateScript = nix-update-script {};
};
meta = {
description = "Open source AI cowork desktop app local alternative to Claude Cowork";
homepage = "https://github.com/eigent-ai/eigent";