Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: AppImage (Linux, nix)

on:
workflow_dispatch:
push:
tags:
- 'v*'

permissions:
contents: read
Expand All @@ -26,6 +23,18 @@ jobs:
extra-conf: |
experimental-features = nix-command flakes

- name: Cache /nix/store
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock', '**/Cargo.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 4G
purge: true
purge-prefixes: nix-${{ runner.os }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never

- name: Build AppImage
run: nix build --print-build-logs .#appimage

Expand All @@ -36,7 +45,7 @@ jobs:
ls -lh out/

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: jayjay-gpui-x86_64.AppImage
path: out/jayjay-gpui-x86_64.AppImage
Expand Down
17 changes: 14 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,25 @@
zstd
];

# Keep cargo sources + shell/gpui/assets (include_bytes! at compile time).
src = pkgs.lib.cleanSourceWith {
src = pkgs.lib.cleanSource ./.;
filter = path: type:
(craneLib.filterCargoSources path type)
|| (pkgs.lib.hasInfix "/assets/" path);
name = "source";
};

commonArgs = {
src = craneLib.cleanCargoSource ./.;
inherit src;
strictDeps = true;
cargoExtraArgs = "-p jayjay-gpui";

nativeBuildInputs = with pkgs; [ pkg-config clang ];
buildInputs = runtimeDeps;

# Tests run in gpui-ci.yml; nix sandbox has no `jj` on PATH.
doCheck = false;
};

cargoArtifacts = craneLib.buildDepsOnly commonArgs;
Expand All @@ -46,8 +58,7 @@
inherit cargoArtifacts;
pname = "jayjay-gpui";

# Bake runtime lib paths into the binary so the AppImage finds Vulkan
# / Wayland / X11 after the closure is packaged.
# rpath so the AppImage finds the dlopen'd libs after bundling.
postFixup = ''
patchelf --set-rpath "${pkgs.lib.makeLibraryPath runtimeDeps}" \
$out/bin/jayjay-gpui || true
Expand Down
Loading