the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Nix (Flakes) installation instructions

Set ELF interpreter for pocketenv on Linux

Avoid autoPatchelfHook; use patchelf instead

Disable the default ELF fixup and stripping hooks and enable patchelf so
the Deno binary's embedded standalone snapshot is preserved (avoids
"Could not find standalone binary section" error)

Disable fixup and wrap pocketenv with linker

Preserve binary and add minimal Linux wrapper

Set dontPatchShebangs and install the untouched binary into $out/bin.
On Linux use a minimal wrapper that execs the dynamic linker
via $0-wrapped to avoid modifying the executable and corrupting
Deno's appended snapshot. Remove macOS symlink logic.

Install binary as .pocketenv-wrapped and use $0

Make the Linux wrapper exec the dynamic linker with $0-wrapped so it
always refers to the final installed location. On macOS, symlink
.pocketenv-wrapped to the public bin name.

Add platform-specific wrapper for pocketenv

Move the original binary into libexec and install a small launcher
per platform. On Linux run the binary via the dynamic linker and
set LD_LIBRARY_PATH; add makeWrapper only for Linux. On Darwin create
a symlink. Preserve the Deno standalone by keeping dontStrip,
dontPatchELF and dontAutoPatchelf.

Unescape shell variables in pocketenv wrapper

Allow LD_LIBRARY_PATH and $@ to be expanded at runtime in the
generated wrapper script

Fix pocketenv wrapper quoting and LD_LIBRARY_PATH

Use template-based pocketenv wrapper on Linux

Make pocketenv LD_LIBRARY_PATH assignment robust

Use an explicit if/else to prepend __LIB_PATH__ to LD_LIBRARY_PATH only
when LD_LIBRARY_PATH is set, avoiding an extra colon and improving
readability and portability.

Replace manual ELF wrapper with patchelf

Disable patchelf and use bin wrapper launcher

Use substituted wrapper script instead of makeWrapper

Remove the nativeBuildInputs requirement for makeWrapper and the
preInstall/postInstall hooks. Create a lightweight wrapper at
$out/bin/pocketenv using the runtimeShell shebang and a "__TARGET__"
placeholder, then use substituteInPlace to replace the placeholder with
the actual libexec path and mark the wrapper executable.

Set default LANG and unset LC_ALL in pocketenv wrapper

Unindent pocketenv heredoc

+48 -36
+5
README.md
··· 39 39 brew install pocketenv-io/tap/pocketenv 40 40 ``` 41 41 42 + **Nix (Flakes):** 43 + ```sh 44 + nix profile install github:pocketenv-io/pocketenv 45 + ``` 46 + 42 47 **Arch Linux:** 43 48 ```sh 44 49 yay -Syu pocketenv
+43 -36
flake.nix
··· 15 15 ] (system: 16 16 let 17 17 pkgs = import nixpkgs { inherit system; }; 18 + lib = pkgs.lib; 18 19 19 20 version = "0.6.0"; 20 21 21 - # Map Nix system strings to pocketenv release target triples 22 22 targetMap = { 23 23 "x86_64-linux" = "x86_64-unknown-linux-gnu"; 24 24 "aarch64-linux" = "aarch64-unknown-linux-gnu"; ··· 26 26 "aarch64-darwin" = "aarch64-apple-darwin"; 27 27 }; 28 28 29 - # Fill these in by running: 30 - # nix-prefetch-url --type sha256 <url> 31 - # or: 32 - # curl -sL <url> | sha256sum 33 - # then convert with: nix hash to-sri --type sha256 <hex> 34 - # 35 - # Example for aarch64-linux: 36 - # nix-prefetch-url --type sha256 \ 37 - # https://github.com/pocketenv-io/pocketenv/releases/download/v0.6.0/pocketenv_v0.6.0_aarch64-unknown-linux-gnu.tar.gz 38 29 hashMap = { 39 30 "x86_64-linux" = "sha256-XzSuI2HmmMcFPaG3ixApiY//9TlQuLrzu3jfecnRLhI="; 40 31 "aarch64-linux" = "sha256-Pzh28zZTocug7/7VuUoPWqDwk+63Y6/iQovZgK2Ur0k="; ··· 43 34 }; 44 35 45 36 target = targetMap.${system}; 46 - hash = hashMap.${system}; 37 + hash = hashMap.${system}; 47 38 48 39 pocketenv = pkgs.stdenv.mkDerivation rec { 49 - pname = "pocketenv"; 40 + pname = "pocketenv"; 50 41 inherit version; 51 42 52 43 src = pkgs.fetchurl { 53 - url = "https://github.com/pocketenv-io/pocketenv/releases/download/v${version}/pocketenv_v${version}_${target}.tar.gz"; 44 + url = "https://github.com/pocketenv-io/pocketenv/releases/download/v${version}/pocketenv_v${version}_${target}.tar.gz"; 54 45 sha256 = hash; 55 46 }; 56 47 57 - # On Linux, patch the ELF interpreter to work under NixOS 58 - nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ 59 - pkgs.autoPatchelfHook 60 - ]; 61 - 62 - # Common C runtime — needed if the Deno binary links glibc 63 - buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ 64 - pkgs.stdenv.cc.cc.lib 65 - ]; 48 + dontStrip = true; 49 + dontPatchELF = true; 50 + dontAutoPatchelf = true; 66 51 67 - # The tarball unpacks directly; tell Nix not to look for a sub-directory 68 - # Adjust sourceRoot if the tarball contains a subdirectory, e.g.: 69 - # sourceRoot = "pocketenv-${version}"; 70 - # Leave commented unless extraction fails. 71 52 sourceRoot = "."; 72 53 73 54 installPhase = '' 74 55 runHook preInstall 75 - install -m755 -D pocketenv $out/bin/pocketenv 56 + 57 + mkdir -p $out/bin 58 + mkdir -p $out/libexec/${pname} 59 + 60 + install -m755 pocketenv $out/libexec/${pname}/pocketenv 61 + 62 + ${lib.optionalString pkgs.stdenv.isLinux '' 63 + cat > $out/bin/pocketenv <<'EOF' 64 + #!${pkgs.runtimeShell} 65 + export LANG="${LANG:-C.UTF-8}" 66 + unset LC_ALL 67 + exec "__TARGET__" "$@" 68 + EOF 69 + 70 + substituteInPlace $out/bin/pocketenv \ 71 + --replace-fail "__TARGET__" "$out/libexec/${pname}/pocketenv" 72 + 73 + chmod +x $out/bin/pocketenv 74 + ''} 75 + 76 + ${lib.optionalString pkgs.stdenv.isDarwin '' 77 + ln -s $out/libexec/${pname}/pocketenv $out/bin/pocketenv 78 + ''} 79 + 76 80 runHook postInstall 77 81 ''; 78 82 79 83 meta = with pkgs.lib; { 80 - description = "pocketenv environment manager"; 81 - homepage = "https://github.com/pocketenv-io/pocketenv"; 82 - license = "MPL-2.0"; 83 - platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 84 - mainProgram = "pocketenv"; 84 + description = "pocketenv - the universal sandbox runtime for agents and humans"; 85 + homepage = "https://github.com/pocketenv-io/pocketenv"; 86 + license = licenses.mpl20; 87 + platforms = [ 88 + "x86_64-linux" 89 + "aarch64-linux" 90 + "x86_64-darwin" 91 + "aarch64-darwin" 92 + ]; 93 + mainProgram = "pocketenv"; 85 94 }; 86 95 }; 87 - 88 96 in { 89 97 packages = { 90 - default = pocketenv; 91 - pocketenv = pocketenv; 98 + default = pocketenv; 99 + inherit pocketenv; 92 100 }; 93 101 94 102 apps.default = flake-utils.lib.mkApp { 95 103 drv = pocketenv; 96 104 }; 97 105 98 - # Development shell with pocketenv available 99 106 devShells.default = pkgs.mkShell { 100 107 buildInputs = [ pocketenv ]; 101 108 };