From ee0078eceaf467764c370bc11f642ebb2fe79203 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Sun, 12 Nov 2023 12:37:49 +0100 Subject: [PATCH 1/9] maintainers: add tensor5 --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index f58e58e88aef7..08cc1639bd0f4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -19707,6 +19707,12 @@ githubId = 2084639; name = "Manu"; }; + tensor5 = { + github = "tensor5"; + githubId = 1545895; + matrix = "@tensor5:matrix.org"; + name = "Nicola Squartini"; + }; teozkr = { email = "teo@nullable.se"; github = "nightkr"; From a2f444a52931a2a0ba104893eb5ba7b161289613 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Sun, 12 Nov 2023 16:21:47 +0100 Subject: [PATCH 2/9] bitbox: init at 4.42.1 --- .../blockchains/bitbox/default.nix | 84 +++++++++++++++++++ .../blockchains/bitbox/genassets.patch | 26 ++++++ .../bitbox/rules.d/51-hid-digitalbitbox.rules | 1 + .../bitbox/rules.d/52-hid-digitalbitbox.rules | 1 + .../bitbox/rules.d/53-hid-bitbox02.rules | 1 + .../bitbox/rules.d/54-hid-bitbox02.rules | 1 + pkgs/top-level/all-packages.nix | 2 + 7 files changed, 116 insertions(+) create mode 100644 pkgs/applications/blockchains/bitbox/default.nix create mode 100644 pkgs/applications/blockchains/bitbox/genassets.patch create mode 100644 pkgs/applications/blockchains/bitbox/rules.d/51-hid-digitalbitbox.rules create mode 100644 pkgs/applications/blockchains/bitbox/rules.d/52-hid-digitalbitbox.rules create mode 100644 pkgs/applications/blockchains/bitbox/rules.d/53-hid-bitbox02.rules create mode 100644 pkgs/applications/blockchains/bitbox/rules.d/54-hid-bitbox02.rules diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/applications/blockchains/bitbox/default.nix new file mode 100644 index 0000000000000..24e073e324b8e --- /dev/null +++ b/pkgs/applications/blockchains/bitbox/default.nix @@ -0,0 +1,84 @@ +{ lib +, stdenv +, fetchFromGitHub +, buildNpmPackage +, clang +, go +, qtwebengine +, wrapQtAppsHook +}: + +stdenv.mkDerivation rec { + pname = "bitbox"; + version = "4.42.1"; + + src = fetchFromGitHub { + owner = "BitBoxSwiss"; + repo = "bitbox-wallet-app"; + rev = "v${version}"; + fetchSubmodules = true; + hash = "sha256-00A4u2tJJ1nho8GFiCjcId27JVKkHf7ge9TfwJUdjaQ="; + }; + + patches = [ + ./genassets.patch + ]; + + postPatch = '' + substituteInPlace frontends/qt/resources/linux/usr/share/applications/bitbox.desktop \ + --replace 'Exec=BitBox %u' 'Exec=bitbox %u' + ''; + + dontConfigure = true; + + passthru.web = buildNpmPackage { + pname = "bitbox-web"; + inherit version; + inherit src; + sourceRoot = "source/frontends/web"; + npmDepsHash = "sha256-0bWf4fVPBo9ZBJv2okyRUW9g9sZDFEPYZmEJlfFZQRI="; + installPhase = "cp -r build $out"; + }; + + buildPhase = '' + runHook preBuild + + ln -s ${passthru.web} frontends/web/build + export GOCACHE=$TMPDIR/go-cache + make -C frontends/qt/server linux + make -C frontends/qt base + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir $out + cp -r frontends/qt/resources/linux/usr/share $out + mkdir $out/{bin,lib} + cp frontends/qt/build/BitBox $out/bin/bitbox + cp frontends/qt/build/assets.rcc $out/bin + cp frontends/qt/server/libserver.so $out/lib + install -Dt $out/lib/udev/rules.d ${./rules.d}/* + + runHook postInstall + ''; + + buildInputs = [ qtwebengine ]; + + nativeBuildInputs = [ + clang + go + wrapQtAppsHook + ]; + + meta = with lib; { + description = "Companion app for the BitBox02 hardware wallet"; + homepage = "https://bitbox.swiss/app/"; + license = licenses.asl20; + mainProgram = "bitbox"; + maintainers = [ maintainers.tensor5 ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/blockchains/bitbox/genassets.patch b/pkgs/applications/blockchains/bitbox/genassets.patch new file mode 100644 index 0000000000000..9bcb1bb88b0a8 --- /dev/null +++ b/pkgs/applications/blockchains/bitbox/genassets.patch @@ -0,0 +1,26 @@ +diff --git a/frontends/qt/Makefile b/frontends/qt/Makefile +index 5ab350554..49d07c0e0 100644 +--- a/frontends/qt/Makefile ++++ b/frontends/qt/Makefile +@@ -16,7 +16,7 @@ include ../../env.mk.inc + + base: + mkdir build +- ./genassets.sh ++ bash genassets.sh + qmake -set MACOS_MIN_VERSION $(MACOS_MIN_VERSION) + qmake -o build/Makefile + cd build && $(MAKE) +diff --git a/frontends/qt/genassets.sh b/frontends/qt/genassets.sh +index 4b1ba87be..b5a9ad279 100755 +--- a/frontends/qt/genassets.sh ++++ b/frontends/qt/genassets.sh +@@ -20,7 +20,7 @@ if [ ! -d ../web/build ]; then + fi + + echo '' > assets.qrc +-/usr/bin/find ../web/build/ -maxdepth 3 -type f | sed -e "s|../web/build/||" | awk '{ print "../web/build/" $1 "" '} >> assets.qrc ++find ../web/build/ -maxdepth 3 -type f | sort | sed -e "s|../web/build/||" | awk '{ print "../web/build/" $1 "" '} >> assets.qrc + + echo 'resources/trayicon.png' >> assets.qrc + echo '' >> assets.qrc diff --git a/pkgs/applications/blockchains/bitbox/rules.d/51-hid-digitalbitbox.rules b/pkgs/applications/blockchains/bitbox/rules.d/51-hid-digitalbitbox.rules new file mode 100644 index 0000000000000..94c86203afaf7 --- /dev/null +++ b/pkgs/applications/blockchains/bitbox/rules.d/51-hid-digitalbitbox.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbb%n", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402" diff --git a/pkgs/applications/blockchains/bitbox/rules.d/52-hid-digitalbitbox.rules b/pkgs/applications/blockchains/bitbox/rules.d/52-hid-digitalbitbox.rules new file mode 100644 index 0000000000000..84fe717211d51 --- /dev/null +++ b/pkgs/applications/blockchains/bitbox/rules.d/52-hid-digitalbitbox.rules @@ -0,0 +1 @@ +KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbbf%n" diff --git a/pkgs/applications/blockchains/bitbox/rules.d/53-hid-bitbox02.rules b/pkgs/applications/blockchains/bitbox/rules.d/53-hid-bitbox02.rules new file mode 100644 index 0000000000000..2daffc03bad26 --- /dev/null +++ b/pkgs/applications/blockchains/bitbox/rules.d/53-hid-bitbox02.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="bitbox02_%n", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403" diff --git a/pkgs/applications/blockchains/bitbox/rules.d/54-hid-bitbox02.rules b/pkgs/applications/blockchains/bitbox/rules.d/54-hid-bitbox02.rules new file mode 100644 index 0000000000000..1b74e47743043 --- /dev/null +++ b/pkgs/applications/blockchains/bitbox/rules.d/54-hid-bitbox02.rules @@ -0,0 +1 @@ +KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="bitbox02-%n" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e24b80b3a1dff..0dcdb72363204 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35822,6 +35822,8 @@ with pkgs; balanceofsatoshis = callPackage ../tools/misc/balanceofsatoshis { }; + bitbox = libsForQt5.callPackage ../applications/blockchains/bitbox {}; + bitcoin = libsForQt5.callPackage ../applications/blockchains/bitcoin { stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; withGui = true; From 175538722b750502e8c3c0d61816c838cba96d77 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Fri, 12 Jul 2024 05:39:57 +0200 Subject: [PATCH 3/9] bitbox: 4.42.1 -> 4.43.0 --- pkgs/applications/blockchains/bitbox/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/applications/blockchains/bitbox/default.nix index 24e073e324b8e..d4010a41e1768 100644 --- a/pkgs/applications/blockchains/bitbox/default.nix +++ b/pkgs/applications/blockchains/bitbox/default.nix @@ -10,14 +10,14 @@ stdenv.mkDerivation rec { pname = "bitbox"; - version = "4.42.1"; + version = "4.43.0"; src = fetchFromGitHub { owner = "BitBoxSwiss"; repo = "bitbox-wallet-app"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-00A4u2tJJ1nho8GFiCjcId27JVKkHf7ge9TfwJUdjaQ="; + hash = "sha256-TvX4p+5Qo85HaUHTrbbsVzrU8sEUXZzGulZzXQXQAPA="; }; patches = [ @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace frontends/qt/resources/linux/usr/share/applications/bitbox.desktop \ - --replace 'Exec=BitBox %u' 'Exec=bitbox %u' + --replace-fail 'Exec=BitBox %u' 'Exec=bitbox %u' ''; dontConfigure = true; @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { inherit version; inherit src; sourceRoot = "source/frontends/web"; - npmDepsHash = "sha256-0bWf4fVPBo9ZBJv2okyRUW9g9sZDFEPYZmEJlfFZQRI="; + npmDepsHash = "sha256-aeSYJGZ+Nx9zlUaxqiXUDJXUqmdahReIoLzkJzm1LCE="; installPhase = "cp -r build $out"; }; From 4a18ff1485f1ca034f9064535b6954c07db51370 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Fri, 4 Oct 2024 20:47:31 +0200 Subject: [PATCH 4/9] bitbox: 4.43.0 -> 4.44.1 --- pkgs/applications/blockchains/bitbox/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/applications/blockchains/bitbox/default.nix index d4010a41e1768..b9c02305b1e64 100644 --- a/pkgs/applications/blockchains/bitbox/default.nix +++ b/pkgs/applications/blockchains/bitbox/default.nix @@ -10,14 +10,14 @@ stdenv.mkDerivation rec { pname = "bitbox"; - version = "4.43.0"; + version = "4.44.1"; src = fetchFromGitHub { owner = "BitBoxSwiss"; repo = "bitbox-wallet-app"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-TvX4p+5Qo85HaUHTrbbsVzrU8sEUXZzGulZzXQXQAPA="; + hash = "sha256-BaQzy0XL9Rd/uRvKeK5yRGl6g9HF69TBCgJ+t7d7lDY="; }; patches = [ @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { inherit version; inherit src; sourceRoot = "source/frontends/web"; - npmDepsHash = "sha256-aeSYJGZ+Nx9zlUaxqiXUDJXUqmdahReIoLzkJzm1LCE="; + npmDepsHash = "sha256-DylU/32t70r/wgjMDBMbaS7egU5DHx7ST7MlZp2zPiw="; installPhase = "cp -r build $out"; }; From 12d8b815c688f2ead2a07c862424be53e496d947 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Fri, 4 Oct 2024 21:10:54 +0200 Subject: [PATCH 5/9] bitbox: fix formatting --- .../applications/blockchains/bitbox/default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/applications/blockchains/bitbox/default.nix index b9c02305b1e64..35e6601122525 100644 --- a/pkgs/applications/blockchains/bitbox/default.nix +++ b/pkgs/applications/blockchains/bitbox/default.nix @@ -1,11 +1,12 @@ -{ lib -, stdenv -, fetchFromGitHub -, buildNpmPackage -, clang -, go -, qtwebengine -, wrapQtAppsHook +{ + lib, + stdenv, + fetchFromGitHub, + buildNpmPackage, + clang, + go, + qtwebengine, + wrapQtAppsHook, }: stdenv.mkDerivation rec { From 32927c0a7fcbbe1e51cd4d696e35dbc0cd018211 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Sat, 5 Oct 2024 08:18:39 +0200 Subject: [PATCH 6/9] bitbox: skip aarch64 --- pkgs/applications/blockchains/bitbox/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/applications/blockchains/bitbox/default.nix index 35e6601122525..08ec7d72370e3 100644 --- a/pkgs/applications/blockchains/bitbox/default.nix +++ b/pkgs/applications/blockchains/bitbox/default.nix @@ -80,6 +80,6 @@ stdenv.mkDerivation rec { license = licenses.asl20; mainProgram = "bitbox"; maintainers = [ maintainers.tensor5 ]; - platforms = platforms.linux; + platforms = [ "x86_64-linux" ]; }; } From 4f6b12e0990d1420d2980b34c3f4ace19912515e Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Fri, 1 Nov 2024 20:58:02 +0100 Subject: [PATCH 7/9] bitbox: remove `with lib` --- pkgs/applications/blockchains/bitbox/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/applications/blockchains/bitbox/default.nix index 08ec7d72370e3..761006b8b24de 100644 --- a/pkgs/applications/blockchains/bitbox/default.nix +++ b/pkgs/applications/blockchains/bitbox/default.nix @@ -74,12 +74,12 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - meta = with lib; { + meta = { description = "Companion app for the BitBox02 hardware wallet"; homepage = "https://bitbox.swiss/app/"; - license = licenses.asl20; + license = lib.licenses.asl20; mainProgram = "bitbox"; - maintainers = [ maintainers.tensor5 ]; + maintainers = [ lib.maintainers.tensor5 ]; platforms = [ "x86_64-linux" ]; }; } From 9729c8ce564dc3f5b302e2575f2bdf200905149a Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Fri, 1 Nov 2024 22:08:22 +0100 Subject: [PATCH 8/9] bitbox: move to `pkgs.by-name` --- .../blockchains => by-name/bi}/bitbox/genassets.patch | 0 .../bitbox/default.nix => by-name/bi/bitbox/package.nix} | 7 +++---- .../bi}/bitbox/rules.d/51-hid-digitalbitbox.rules | 0 .../bi}/bitbox/rules.d/52-hid-digitalbitbox.rules | 0 .../bi}/bitbox/rules.d/53-hid-bitbox02.rules | 0 .../bi}/bitbox/rules.d/54-hid-bitbox02.rules | 0 pkgs/top-level/all-packages.nix | 2 -- 7 files changed, 3 insertions(+), 6 deletions(-) rename pkgs/{applications/blockchains => by-name/bi}/bitbox/genassets.patch (100%) rename pkgs/{applications/blockchains/bitbox/default.nix => by-name/bi/bitbox/package.nix} (95%) rename pkgs/{applications/blockchains => by-name/bi}/bitbox/rules.d/51-hid-digitalbitbox.rules (100%) rename pkgs/{applications/blockchains => by-name/bi}/bitbox/rules.d/52-hid-digitalbitbox.rules (100%) rename pkgs/{applications/blockchains => by-name/bi}/bitbox/rules.d/53-hid-bitbox02.rules (100%) rename pkgs/{applications/blockchains => by-name/bi}/bitbox/rules.d/54-hid-bitbox02.rules (100%) diff --git a/pkgs/applications/blockchains/bitbox/genassets.patch b/pkgs/by-name/bi/bitbox/genassets.patch similarity index 100% rename from pkgs/applications/blockchains/bitbox/genassets.patch rename to pkgs/by-name/bi/bitbox/genassets.patch diff --git a/pkgs/applications/blockchains/bitbox/default.nix b/pkgs/by-name/bi/bitbox/package.nix similarity index 95% rename from pkgs/applications/blockchains/bitbox/default.nix rename to pkgs/by-name/bi/bitbox/package.nix index 761006b8b24de..ef0e4ada12841 100644 --- a/pkgs/applications/blockchains/bitbox/default.nix +++ b/pkgs/by-name/bi/bitbox/package.nix @@ -5,8 +5,7 @@ buildNpmPackage, clang, go, - qtwebengine, - wrapQtAppsHook, + libsForQt5, }: stdenv.mkDerivation rec { @@ -66,12 +65,12 @@ stdenv.mkDerivation rec { runHook postInstall ''; - buildInputs = [ qtwebengine ]; + buildInputs = [ libsForQt5.qtwebengine ]; nativeBuildInputs = [ clang go - wrapQtAppsHook + libsForQt5.wrapQtAppsHook ]; meta = { diff --git a/pkgs/applications/blockchains/bitbox/rules.d/51-hid-digitalbitbox.rules b/pkgs/by-name/bi/bitbox/rules.d/51-hid-digitalbitbox.rules similarity index 100% rename from pkgs/applications/blockchains/bitbox/rules.d/51-hid-digitalbitbox.rules rename to pkgs/by-name/bi/bitbox/rules.d/51-hid-digitalbitbox.rules diff --git a/pkgs/applications/blockchains/bitbox/rules.d/52-hid-digitalbitbox.rules b/pkgs/by-name/bi/bitbox/rules.d/52-hid-digitalbitbox.rules similarity index 100% rename from pkgs/applications/blockchains/bitbox/rules.d/52-hid-digitalbitbox.rules rename to pkgs/by-name/bi/bitbox/rules.d/52-hid-digitalbitbox.rules diff --git a/pkgs/applications/blockchains/bitbox/rules.d/53-hid-bitbox02.rules b/pkgs/by-name/bi/bitbox/rules.d/53-hid-bitbox02.rules similarity index 100% rename from pkgs/applications/blockchains/bitbox/rules.d/53-hid-bitbox02.rules rename to pkgs/by-name/bi/bitbox/rules.d/53-hid-bitbox02.rules diff --git a/pkgs/applications/blockchains/bitbox/rules.d/54-hid-bitbox02.rules b/pkgs/by-name/bi/bitbox/rules.d/54-hid-bitbox02.rules similarity index 100% rename from pkgs/applications/blockchains/bitbox/rules.d/54-hid-bitbox02.rules rename to pkgs/by-name/bi/bitbox/rules.d/54-hid-bitbox02.rules diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0dcdb72363204..e24b80b3a1dff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35822,8 +35822,6 @@ with pkgs; balanceofsatoshis = callPackage ../tools/misc/balanceofsatoshis { }; - bitbox = libsForQt5.callPackage ../applications/blockchains/bitbox {}; - bitcoin = libsForQt5.callPackage ../applications/blockchains/bitcoin { stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; withGui = true; From 26cc2cf4b1b5891c871f65246a459638352d3723 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Fri, 1 Nov 2024 22:50:09 +0100 Subject: [PATCH 9/9] bitbox: 4.44.1 -> 4.45.0 --- pkgs/by-name/bi/bitbox/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/bi/bitbox/package.nix b/pkgs/by-name/bi/bitbox/package.nix index ef0e4ada12841..378735578ea54 100644 --- a/pkgs/by-name/bi/bitbox/package.nix +++ b/pkgs/by-name/bi/bitbox/package.nix @@ -10,14 +10,14 @@ stdenv.mkDerivation rec { pname = "bitbox"; - version = "4.44.1"; + version = "4.45.0"; src = fetchFromGitHub { owner = "BitBoxSwiss"; repo = "bitbox-wallet-app"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-BaQzy0XL9Rd/uRvKeK5yRGl6g9HF69TBCgJ+t7d7lDY="; + hash = "sha256-miy7uLNWvLacLOrlpsUE/nR/JNBkcueJX8/mX+abeAg="; }; patches = [