nixpkgs/pkgs/applications/networking/cozy-drive/default.nix
Peder Bergebakken Sundt 985aa8174d treewide: unbreak appimageTools.wrapType2 builds
`appimageTools.wrapType2` no longer creates a binary `$out/bin/${name}` if `pname` and `version` is provided.
Derivations that have worked around this behavior with a `mv $out/bin/{${name},${pname}}` broke as a result.
This should fix most instances.

contex: #271071
2024-04-24 15:26:52 +02:00

35 lines
1.0 KiB
Nix

{ lib
, fetchurl
, appimageTools
}:
let
pname = "cozydrive";
version = "3.38.0";
src = fetchurl {
url = "https://github.com/cozy-labs/cozy-desktop/releases/download/v${version}/Cozy-Drive-${version}-x86_64.AppImage";
sha256 = "3liOzZVOjtV1cGrKlOKiFRRqnt8KHPr5Ye5HU0e/BYo=";
};
appimageContents = appimageTools.extract { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/cozydrive.desktop -t $out/share/applications
substituteInPlace $out/share/applications/cozydrive.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
meta = with lib; {
description = "Cozy Drive is a synchronization tool for your files and folders with Cozy Cloud.";
homepage = "https://cozy.io";
license = licenses.gpl3Only;
maintainers = with maintainers; [ simarra ];
platforms = [ "x86_64-linux" ];
mainProgram = "cozydrive";
};
}