2023-11-16 04:20:00 +00:00
|
|
|
{ stdenv, lib, fetchurl, appimageTools, makeWrapper, electron, nixosTests }:
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "freetube";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.19.2";
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/FreeTubeApp/FreeTube/releases/download/v${version}-beta/freetube_${version}_amd64.AppImage";
|
2024-02-29 20:09:43 +00:00
|
|
|
sha256 = "sha256-GhlU02CmglHUzVTqoajXFS1E6WXxXjxRTdiDEDqsH8s=";
|
2021-03-23 19:22:30 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests = nixosTests.freetube;
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/icons/hicolor/scalable/apps
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
|
|
|
|
cp -a ${appimageContents}/freetube.desktop $out/share/applications/${pname}.desktop
|
2022-03-30 09:31:56 +00:00
|
|
|
cp -a ${appimageContents}/usr/share/icons/hicolor/scalable/freetube.svg $out/share/icons/hicolor/scalable/apps
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
2024-02-29 20:09:43 +00:00
|
|
|
--add-flags $out/share/${pname}/resources/app.asar \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
|
2021-03-23 19:22:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "An Open Source YouTube app for privacy";
|
|
|
|
homepage = "https://freetubeapp.io/";
|
|
|
|
license = licenses.agpl3Only;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ ryneeverett alyaeanyx ];
|
2023-11-16 04:20:00 +00:00
|
|
|
inherit (electron.meta) platforms;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "freetube";
|
2021-03-23 19:22:30 +00:00
|
|
|
};
|
|
|
|
}
|