11 stdenv.mkDerivation rec {
16 url = "https://github.com/FreeTubeApp/FreeTube/releases/download/v${version}-beta/freetube_${version}_amd64.AppImage";
17 hash = "sha256-sg/ycFo4roOJ2sW4naRCE6dwGXVQFzF8uwAZQkS2EY4=";
20 passthru.tests = nixosTests.freetube;
22 appimageContents = appimageTools.extractType2 { inherit pname version src; };
28 nativeBuildInputs = [ makeWrapper ];
33 mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/icons/hicolor/scalable/apps
35 cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
36 cp -a ${appimageContents}/freetube.desktop $out/share/applications/${pname}.desktop
37 cp -a ${appimageContents}/usr/share/icons/hicolor/scalable/freetube.svg $out/share/icons/hicolor/scalable/apps
39 substituteInPlace $out/share/applications/${pname}.desktop \
40 --replace 'Exec=AppRun' 'Exec=${pname}'
46 makeWrapper ${electron}/bin/electron $out/bin/${pname} \
47 --add-flags $out/share/${pname}/resources/app.asar \
48 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
52 description = "Open Source YouTube app for privacy";
53 homepage = "https://freetubeapp.io/";
54 license = lib.licenses.agpl3Only;
55 maintainers = with lib.maintainers; [
59 inherit (electron.meta) platforms;
60 mainProgram = "freetube";