nixpkgs/pkgs/by-name/be/beeper/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
2.4 KiB
Nix
Raw Normal View History

2023-10-07 20:25:11 +00:00
{ lib
2023-10-11 05:17:37 +00:00
, stdenvNoCC
2023-10-07 20:25:11 +00:00
, fetchurl
, appimageTools
, makeWrapper
, writeShellApplication
, curl
, yq
, common-updater-scripts
}:
2023-07-06 23:00:32 +00:00
let
pname = "beeper";
2024-10-01 16:57:05 +00:00
version = "3.109.1";
2023-07-06 23:00:32 +00:00
src = fetchurl {
2024-10-01 16:57:05 +00:00
url = "https://download.todesktop.com/2003241lzgn20jd/beeper-3.109.1-build-240923466rji1i4-x86_64.AppImage";
hash = "sha256-RXpoOgnoPmNID5Jx/lNxqsHsifFSS9dZzhjSu8kGtXc=";
2023-07-06 23:00:32 +00:00
};
appimage = appimageTools.wrapType2 {
inherit version pname src;
extraPkgs = pkgs: [ pkgs.libsecret ];
2023-07-06 23:00:32 +00:00
};
appimageContents = appimageTools.extractType2 {
inherit version pname src;
};
in
2023-10-11 05:17:37 +00:00
stdenvNoCC.mkDerivation rec {
2024-06-29 04:30:58 +00:00
inherit pname version;
2023-07-06 23:00:32 +00:00
src = appimage;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -r bin $out/bin
mkdir -p $out/share/${pname}
cp -a ${appimageContents}/locales $out/share/${pname}
cp -a ${appimageContents}/resources $out/share/${pname}
cp -a ${appimageContents}/usr/share/icons $out/share/
install -Dm 644 ${appimageContents}/${pname}.desktop -t $out/share/applications/
substituteInPlace $out/share/applications/${pname}.desktop --replace "AppRun" "${pname}"
wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}} --no-update"
runHook postInstall
'';
2023-10-07 20:25:11 +00:00
passthru = {
updateScript = lib.getExe (writeShellApplication {
name = "update-beeper";
runtimeInputs = [ curl yq common-updater-scripts ];
text = ''
set -o errexit
latestLinux="$(curl -s https://download.todesktop.com/2003241lzgn20jd/latest-linux.yml)"
version="$(echo "$latestLinux" | yq -r .version)"
filename="$(echo "$latestLinux" | yq -r '.files[] | .url | select(. | endswith(".AppImage"))')"
update-source-version beeper "$version" "" "https://download.todesktop.com/2003241lzgn20jd/$filename" --source-key=src.src
'';
});
};
2023-07-06 23:00:32 +00:00
meta = with lib; {
description = "Universal chat app";
longDescription = ''
Beeper is a universal chat app. With Beeper, you can send
and receive messages to friends, family and colleagues on
many different chat networks.
'';
homepage = "https://beeper.com";
license = licenses.unfree;
maintainers = with maintainers; [ jshcmpbll mjm edmundmiller ];
2023-07-06 23:00:32 +00:00
platforms = [ "x86_64-linux" ];
};
}