I am trying to package this AppImage Application.
But I ran into an issue when running it with appimage-run.
The application is unable to open links in the browser, which is required to authenticate.
ChatGPT thinks that the issue lies with a missing xdg-open dependency and tried to add it with makeWrapper $out/bin/${pname} $out/bin/${pname} --prefix PATH : ${pkgs.xdg_utils}/bin
Which caused the application to stop working.
{ pkgs ? import <nixpkgs> { } }:
let
version = "1.0.1";
pname = "code-expert-sync";
name = "${pname}-${version}";
src = pkgs.fetchurl {
url = "https://github.com/CodeExpertETH/CodeExpertSync/releases/download/v${version}/code-expert-sync_${version}_amd64.AppImage";
hash = "sha256-zz222IqkxOjdnquGCZpRE1i6fzveMMRY3jbe3xfAoBs=";
};
appimageContents = pkgs.appimageTools.extractType1 { inherit name src; };
in
pkgs.appimageTools.wrapType1 {
inherit name src;
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
extraInstallCommands = ''
mv $out/bin/${name} $out/bin/${pname}
# install -Dm755 ${appimageContents}/usr/bin/${pname} $out/bin/${pname}
install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
# substituteInPlace $out/share/applications/${pname}.desktop --replace-fail 'Exec=AppRun' 'Exec=${pname}' # not necessary already the case
cp -r ${appimageContents}/usr/share/icons $out/share
# makeWrapper $out/bin/${pname} $out/bin/${pname} \
# --prefix PATH : ${pkgs.xdg_utils}/bin
'';
meta = {
description = "Code Expert Sync allows syncing projects to a local file system. This allows students and lecturers to edit code with their own IDE and create local backups.";
homepage = "https://github.com/CodeExpertETH/CodeExpertSync";
downloadPage = "https://github.com/CodeExpertETH/CodeExpertSync/releases/tag/v1.0.1";
license = pkgs.lib.licenses.mit;
sourceProvenance = with pkgs.lib.sourceTypes; [ binaryNativeCode ];
maintainers = [ "me" ];
platforms = [ "x86_64-linux" ];
};
}