summary refs log tree commit diff
path: root/pkgs/applications/video/lbry/default.nix
blob: ea69ea547df873d62b07edba1499b2247b8620d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib, fetchurl, appimageTools}:

let
  pname = "lbry-desktop";
  version = "0.52.5";
in appimageTools.wrapAppImage rec {
  name = "${pname}-${version}";

  # Fetch from GitHub Releases and extract
  src = appimageTools.extract {
    inherit name;
    src = fetchurl {
      url = "https://github.com/lbryio/lbry-desktop/releases/download/v${version}/LBRY_${version}.AppImage";
      # Gotten from latest-linux.yml
      sha512 = "i0t1Ygf3el7Brh6TA804V6n5r5UczvOPxAdhyJ7Gvvg9VqN1+QXB6hsqF4jYTW3jcKxvorVALwrFDVezBTPv5g==";
    };
  };

  # At runtime, Lbry likes to have access to Ffmpeg
  extraPkgs = pkgs: with pkgs; [
    ffmpeg
  ];

  # General fixup
  extraInstallCommands = ''
    # Firstly, rename the executable to lbry for convinence
    mv $out/bin/${name} $out/bin/lbry

    # Now, install assets such as the desktop file and icons
    install -m 444 -D ${src}/lbry.desktop -t $out/share/applications
    substituteInPlace $out/share/applications/lbry.desktop \
      --replace 'Exec=AppRun' 'Exec=lbry'
    cp -r ${src}/usr/share/icons $out/share
  '';

  meta = with lib; {
    description = "A browser and wallet for LBRY, the decentralized, user-controlled content marketplace";
    longDescription = ''
      The LBRY app is a graphical browser for the decentralized content marketplace provided by the LBRY protocol.
      It is essentially the lbry daemon bundled with a UI using Electron.
    '';
    license = licenses.mit;
    homepage = "https://lbry.com/";
    downloadPage = "https://lbry.com/get/";
    changelog = "https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md";
    maintainers = with maintainers; [ enderger ];
    platforms = [ "x86_64-linux" ];
  };
}