Skip to content

Instantly share code, notes, and snippets.

@gvolpe
Last active August 9, 2020 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvolpe/666d80ab172f8f3cd5e4250997d0d7a4 to your computer and use it in GitHub Desktop.
Save gvolpe/666d80ab172f8f3cd5e4250997d0d7a4 to your computer and use it in GitHub Desktop.
{
appimagePackage = { binName, version, url, sha256 ? fakeSha256
, meta ? { platforms = [ "x86_64-linux" ]; } }:
let
pname = "${binName}-appimage";
name = "${pname}-${version}";
src = fetchurl {
inherit url sha256;
name = "${name}.AppImage";
};
appimageContents = appimageTools.extractType2 { inherit name src; };
in appimageTools.wrapType2 {
inherit name src meta;
extraInstallCommands = ''
mv $out/bin/${name} $out/bin/${binName}
install -m 444 -D ${appimageContents}/*.desktop $out/share/applications/${binName}.desktop
sed -i 's/Exec=.*/Exec=${binName}/g' $out/share/applications/${binName}.desktop
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment