Appimage/en: Difference between revisions

FuzzyBot (talk | contribs)
Updating to match new version of source page
FuzzyBot (talk | contribs)
Updating to match new version of source page
Line 15: Line 15:


See the [https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools nixpkgs manual on wrapping AppImage packages]. In short, the AppImage is extracted and any dependencies are added as nix build dependencies.
See the [https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools nixpkgs manual on wrapping AppImage packages]. In short, the AppImage is extracted and any dependencies are added as nix build dependencies.
Following example is a derivation for the program Quba, which is also distributed as AppImage.<syntaxhighlight lang="nix">
Following example is a derivation for the program Quba, which is also distributed as AppImage.
 
<syntaxhighlight lang="nix">
{
{
   lib,
   lib,
Line 22: Line 24:
}:
}:


<!--T:11-->
let
let
   version = "1.4.0";
   version = "1.4.0";
Line 27: Line 30:
   name = "${pname}-${version}";
   name = "${pname}-${version}";


   src = fetchurl {
   <!--T:12-->
src = fetchurl {
     url = "https://github.com/ZUGFeRD/quba-viewer/releases/download/v${version}/Quba-${version}.AppImage";
     url = "https://github.com/ZUGFeRD/quba-viewer/releases/download/v${version}/Quba-${version}.AppImage";
     hash = "sha256-EsTF7W1np5qbQQh3pdqsFe32olvGK3AowGWjqHPEfoM=";
     hash = "sha256-EsTF7W1np5qbQQh3pdqsFe32olvGK3AowGWjqHPEfoM=";
   };
   };


   appimageContents = appimageTools.extractType1 { inherit name src; };
   <!--T:13-->
appimageContents = appimageTools.extractType1 { inherit name src; };
in
in
appimageTools.wrapType1 {
appimageTools.wrapType1 {
   inherit name src;
   inherit name src;


   extraInstallCommands = ''
   <!--T:14-->
extraInstallCommands = ''
     mv $out/bin/${name} $out/bin/${pname}
     mv $out/bin/${name} $out/bin/${pname}
     install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
     install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
Line 45: Line 51:
   '';
   '';


   meta = {
   <!--T:15-->
meta = {
     description = "Viewer for electronic invoices";
     description = "Viewer for electronic invoices";
     homepage = "https://github.com/ZUGFeRD/quba-viewer";
     homepage = "https://github.com/ZUGFeRD/quba-viewer";