nixpkgs/pkgs/applications/audio/cider/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

34 lines
1.2 KiB
Nix

{ appimageTools, lib, fetchurl, makeWrapper}:
appimageTools.wrapType2 rec {
pname = "cider";
version = "1.6.2";
src = fetchurl {
url = "https://github.com/ciderapp/Cider/releases/download/v${version}/Cider-${version}.AppImage";
sha256 = "sha256-43QmTnFp8raEyZO5NK/UlRM8Ykd0y4iaYlL3MpROmsk=";
};
extraInstallCommands =
let contents = appimageTools.extract { inherit pname version src; };
in ''
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
install -m 444 -D ${contents}/${pname}.desktop -t $out/share/applications
substituteInPlace $out/share/applications/${pname}.desktop \
--replace-warn 'Exec=AppRun' 'Exec=${pname}'
cp -r ${contents}/usr/share/icons $out/share
'';
meta = with lib; {
description = "A new look into listening and enjoying Apple Music in style and performance.";
homepage = "https://github.com/ciderapp/Cider";
license = licenses.agpl3Only;
mainProgram = "cider";
maintainers = [ maintainers.cigrainger ];
platforms = [ "x86_64-linux" ];
};
}