Skip to content

Commit

Permalink
sparrow: 1.7.1 -> 1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelrosa committed Mar 13, 2023
1 parent e047a2b commit a8e4441
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
29 changes: 6 additions & 23 deletions pkgs/applications/blockchains/sparrow/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

let
pname = "sparrow";
version = "1.7.1";
version = "1.7.3";

src = fetchurl {
url = "https://github.com/sparrowwallet/${pname}/releases/download/${version}/${pname}-${version}-x86_64.tar.gz";
sha256 = "0q31b4ncvbhr9gb47wplphg43pwlg5vpd1b12qiidqlrkgm2vjy8";
sha256 = "sha256-/tKct73v0zWAjY4kTllnb/+SB/8ENgVl8Yh/LErKTxY=";
};

launcher = writeScript "sparrow" ''
Expand Down Expand Up @@ -156,24 +156,6 @@ let
ln -s ${hwi}/bin/hwi $out/modules/com.sparrowwallet.sparrow/native/linux/x64/hwi
'';
};

# To use the udev rules for connected hardware wallets,
# add "pkgs.sparrow" to "services.udev.packages" and add user accounts to the user group "plugdev".
udev-rules = stdenv.mkDerivation {
name = "sparrow-udev";

src = let version = "2.0.2"; in
fetchurl {
url = "https://github.com/bitcoin-core/HWI/releases/download/${version}/hwi-${version}.tar.gz";
sha256 = "sha256-di1fRsMbwpHcBFNTCVivfxpwhUoUKLA3YTnJxKq/jHM=";
};

installPhase = ''
mkdir -p $out/etc/udev/rules.d
cp -a hwilib/udev/* $out/etc/udev/rules.d
rm $out/etc/udev/rules.d/README.md
'';
};
in
stdenv.mkDerivation rec {
inherit pname version src;
Expand All @@ -186,8 +168,9 @@ stdenv.mkDerivation rec {
icon = pname;
desktopName = "Sparrow Bitcoin Wallet";
genericName = "Bitcoin Wallet";
categories = [ "Finance" ];
categories = [ "Finance" "Network" ];
mimeTypes = [ "application/psbt" "application/bitcoin-transaction" "x-scheme-handler/bitcoin" "x-scheme-handler/auth47" "x-scheme-handler/lightning" ];
startupWMClass = "Sparrow";
})
];

Expand Down Expand Up @@ -217,8 +200,8 @@ stdenv.mkDerivation rec {
mkdir -p $out/share/icons
ln -s ${sparrow-icons}/hicolor $out/share/icons
mkdir -p $out/etc/udev
ln -s ${udev-rules}/etc/udev/rules.d $out/etc/udev/rules.d
mkdir -p $out/etc/udev/rules.d
cp ${hwi}/lib/python*/site-packages/hwilib/udev/*.rules $out/etc/udev/rules.d
runHook postInstall
'';
Expand Down
30 changes: 30 additions & 0 deletions pkgs/applications/blockchains/sparrow/fhsenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ lib
, buildFHSUserEnv
, sparrow-unwrapped
}:

buildFHSUserEnv {
name = "sparrow";

runScript = "${sparrow-unwrapped}/bin/sparrow";

targetPkgs = pkgs: with pkgs; [
sparrow-unwrapped
pcsclite
];

multiPkgs = pkgs: with pkgs; [
pcsclite
];

extraInstallCommands = ''
mkdir -p $out/share
ln -s ${sparrow-unwrapped}/share/applications $out/share
ln -s ${sparrow-unwrapped}/share/icons $out/share
mkdir -p $out/etc/udev
ln -s ${sparrow-unwrapped}/etc/udev/rules.d $out/etc/udev/rules.d
'';

meta = sparrow-unwrapped.meta;
}
8 changes: 6 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12267,8 +12267,12 @@ with pkgs;

sozu = callPackage ../servers/sozu { };

sparrow = callPackage ../applications/blockchains/sparrow {
openimajgrabber = callPackage ../applications/blockchains/sparrow/openimajgrabber.nix { };
sparrow-unwrapped = callPackage ../applications/blockchains/sparrow {
openimajgrabber = callPackage ../applications/blockchains/sparrow/openimajgrabber.nix {};
};

sparrow = callPackage ../applications/blockchains/sparrow/fhsenv.nix {
buildFHSUserEnv = buildFHSUserEnvBubblewrap;
};

sparsehash = callPackage ../development/libraries/sparsehash { };
Expand Down

0 comments on commit a8e4441

Please sign in to comment.