2021-10-01 09:20:50 +00:00
|
|
|
{ lib, fetchurl, appimageTools, imagemagick, systemd }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "ledger-live-desktop";
|
2021-09-23 15:35:13 +00:00
|
|
|
version = "2.33.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/LedgerHQ/${pname}/releases/download/v${version}/${pname}-${version}-linux-x86_64.AppImage";
|
2021-09-23 15:35:13 +00:00
|
|
|
sha256 = "1k1h37fbpsib9h8867m2dsfacdjs78gdm61gvrin5gpw1zj10syz";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
inherit name src;
|
|
|
|
};
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
# Hotplug events from udevd are fired into the kernel, which then re-broadcasts them over a
|
|
|
|
# special socket, to every libudev client listening for hotplug when the kernel does that. It will
|
|
|
|
# try to preserve the uid of the sender but a non-root namespace (like the fhs-env) cant map root
|
|
|
|
# to a uid, for security reasons, so the uid of the sender becomes nobody and libudev actively
|
|
|
|
# rejects such messages. This patch disables that bit of security in libudev.
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/issues/116361
|
|
|
|
systemdPatched = systemd.overrideAttrs ({ patches ? [ ], ... }: {
|
|
|
|
patches = patches ++ [ ./systemd.patch ];
|
|
|
|
});
|
|
|
|
in
|
|
|
|
appimageTools.wrapType2 rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit name src;
|
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
extraPkgs = pkgs: [ systemdPatched ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
extraInstallCommands = ''
|
|
|
|
mv $out/bin/${name} $out/bin/${pname}
|
|
|
|
install -m 444 -D ${appimageContents}/ledger-live-desktop.desktop $out/share/applications/ledger-live-desktop.desktop
|
|
|
|
install -m 444 -D ${appimageContents}/ledger-live-desktop.png $out/share/icons/hicolor/1024x1024/apps/ledger-live-desktop.png
|
|
|
|
${imagemagick}/bin/convert ${appimageContents}/ledger-live-desktop.png -resize 512x512 ledger-live-desktop_512.png
|
|
|
|
install -m 444 -D ledger-live-desktop_512.png $out/share/icons/hicolor/512x512/apps/ledger-live-desktop.png
|
|
|
|
substituteInPlace $out/share/applications/ledger-live-desktop.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Wallet app for Ledger Nano S and Ledger Blue";
|
|
|
|
homepage = "https://www.ledger.com/live";
|
|
|
|
license = licenses.mit;
|
2021-08-05 21:33:18 +00:00
|
|
|
maintainers = with maintainers; [ andresilva thedavidmeister nyanloutre RaghavSood th0rgal ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|