Drop codex desktop local library patch
This commit is contained in:
102
nixos/nix.nix
102
nixos/nix.nix
@@ -109,105 +109,9 @@
|
|||||||
(import ./emacs-overlay.nix)
|
(import ./emacs-overlay.nix)
|
||||||
(import ../nix-shared/overlays)
|
(import ../nix-shared/overlays)
|
||||||
# Use codex and claude-code from dedicated flakes with cachix
|
# Use codex and claude-code from dedicated flakes with cachix
|
||||||
(final: prev: let
|
(final: prev: {
|
||||||
system = prev.stdenv.hostPlatform.system;
|
codex = inputs.codex-cli-nix.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
codexDmg = final.fetchurl {
|
codex-desktop-installer = inputs.codex-desktop-linux.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
url = "https://persistent.oaistatic.com/codex-app-prod/Codex.dmg";
|
|
||||||
hash = "sha256-hxuafsEAmx1OQvjh8riI7Y4QxvZXemBrjpRHT8Bh034=";
|
|
||||||
};
|
|
||||||
codexDesktopLibPath = final.lib.makeLibraryPath (with final; [
|
|
||||||
alsa-lib
|
|
||||||
atk
|
|
||||||
at-spi2-atk
|
|
||||||
at-spi2-core
|
|
||||||
cairo
|
|
||||||
cups
|
|
||||||
dbus
|
|
||||||
expat
|
|
||||||
gdk-pixbuf
|
|
||||||
glib
|
|
||||||
gtk3
|
|
||||||
libdrm
|
|
||||||
libgbm
|
|
||||||
libglvnd
|
|
||||||
libX11
|
|
||||||
libxcb
|
|
||||||
libXcomposite
|
|
||||||
libxcursor
|
|
||||||
libXdamage
|
|
||||||
libXext
|
|
||||||
libXfixes
|
|
||||||
libxi
|
|
||||||
libxkbcommon
|
|
||||||
libXrandr
|
|
||||||
libxscrnsaver
|
|
||||||
libxtst
|
|
||||||
mesa
|
|
||||||
nspr
|
|
||||||
nss
|
|
||||||
pango
|
|
||||||
systemd
|
|
||||||
wayland
|
|
||||||
]);
|
|
||||||
codexDesktopInstaller = final.writeShellApplication {
|
|
||||||
name = "codex-desktop-installer";
|
|
||||||
runtimeInputs = with final; [
|
|
||||||
bash
|
|
||||||
curl
|
|
||||||
gcc
|
|
||||||
gnumake
|
|
||||||
nodejs
|
|
||||||
p7zip
|
|
||||||
patchelf
|
|
||||||
python3
|
|
||||||
unzip
|
|
||||||
];
|
|
||||||
text = ''
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
root_dir="$(pwd)"
|
|
||||||
workdir="$(mktemp -d)"
|
|
||||||
source_dir="$workdir/source"
|
|
||||||
cleanup() {
|
|
||||||
rm -rf "$workdir"
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
mkdir -p "$source_dir"
|
|
||||||
cp -R ${inputs.codex-desktop-linux.outPath}/. "$source_dir"
|
|
||||||
chmod -R u+w "$source_dir"
|
|
||||||
cp ${codexDmg} "$source_dir/Codex.dmg"
|
|
||||||
chmod +x "$source_dir/install.sh"
|
|
||||||
|
|
||||||
cd "$source_dir"
|
|
||||||
export CODEX_INSTALL_DIR="''${CODEX_INSTALL_DIR:-$root_dir/codex-app}"
|
|
||||||
bash "$source_dir/install.sh" "$source_dir/Codex.dmg" "$@"
|
|
||||||
|
|
||||||
install_dir="''${CODEX_INSTALL_DIR:-$root_dir/codex-app}"
|
|
||||||
if [ -f "$install_dir/electron" ]; then
|
|
||||||
patchelf --set-interpreter "$(cat ${final.stdenv.cc}/nix-support/dynamic-linker)" \
|
|
||||||
--set-rpath "$install_dir:${codexDesktopLibPath}" \
|
|
||||||
"$install_dir/electron"
|
|
||||||
|
|
||||||
if [ -f "$install_dir/chrome_crashpad_handler" ]; then
|
|
||||||
patchelf --set-interpreter "$(cat ${final.stdenv.cc}/nix-support/dynamic-linker)" \
|
|
||||||
"$install_dir/chrome_crashpad_handler" || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$install_dir/chrome-sandbox" ]; then
|
|
||||||
patchelf --set-interpreter "$(cat ${final.stdenv.cc}/nix-support/dynamic-linker)" \
|
|
||||||
"$install_dir/chrome-sandbox" || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
find "$install_dir" -maxdepth 1 -name "*.so*" -type f | while read -r so; do
|
|
||||||
patchelf --set-rpath "${codexDesktopLibPath}" "$so" 2>/dev/null || true
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
codex = inputs.codex-cli-nix.packages.${system}.default;
|
|
||||||
codex-desktop-installer = codexDesktopInstaller;
|
|
||||||
codex-desktop = final.writeShellApplication {
|
codex-desktop = final.writeShellApplication {
|
||||||
name = "codex-desktop";
|
name = "codex-desktop";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
|
|||||||
Reference in New Issue
Block a user