19 , SUBSYSTEM=="usb", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbb%n", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402"
22 , KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbbf%n"
27 # Enabling the digitalbitbox program
29 # programs.digitalbitbox.enable = true;
31 # will install the digitalbitbox package and enable the corresponding hardware
32 # module and is by far the easiest way to get started with the Digital Bitbox on
35 # In case you install the package only, please be aware that you may need to
36 # apply some udev rules to allow the application to identify and access your
37 # wallet. In a nixos-configuration, one may accomplish this by enabling the
38 # digitalbitbox hardware module
40 # hardware.digitalbitbox.enable = true;
42 # or by adding the digitalbitbox package to system.udev.packages
44 # system.udev.packages = [ pkgs.digitalbitbox ];
46 # See https://digitalbitbox.com/start_linux for more information.
48 copyUdevRuleToOutput = name: rule:
49 "cp ${writeText name rule} $out/etc/udev/rules.d/${name}";
51 pname = "digitalbitbox";
54 src = fetchFromGitHub {
55 owner = "digitalbitbox";
58 sha256 = "ig3+TdYv277D9GVnkRSX6nc6D6qruUOw/IQdQCK6FoA=";
82 LUPDATE="${qttools.dev}/bin/lupdate";
83 LRELEASE="${qttools.dev}/bin/lrelease";
84 MOC="${qtbase.dev}/bin/moc";
86 RCC="${qtbase.dev}/bin/rcc";
87 UIC="${qtbase.dev}/bin/uic";
97 qtWrapperArgs = [ "--prefix LD_LIBRARY_PATH : $out/lib" ];
101 cp src/libbtc/.libs/*.so* $out/lib
102 cp src/libbtc/src/secp256k1/.libs/*.so* $out/lib
103 cp src/hidapi/libusb/.libs/*.so* $out/lib
104 cp src/univalue/.libs/*.so* $out/lib
106 # Provide udev rules as documented in https://digitalbitbox.com/start_linux
107 mkdir -p "$out/etc/udev/rules.d"
108 ${copyUdevRuleToOutput "51-hid-digitalbox.rules" udevRule51}
109 ${copyUdevRuleToOutput "52-hid-digitalbox.rules" udevRule52}
112 # remove forbidden references to $TMPDIR
114 for f in "$out"/{bin,lib}/*; do
115 if [ -f "$f" ] && isELF "$f"; then
116 patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
121 enableParallelBuilding = true;
124 description = "QT based application for the Digital Bitbox hardware wallet";
126 Digital Bitbox provides dbb-app, a GUI tool, and dbb-cli, a CLI tool, to manage Digital Bitbox devices.
128 This package will only install the dbb-app and dbb-cli, however; in order for these applications to identify and access Digital Bitbox devices, one may want to enable the digitalbitbox hardware module by adding
130 hardware.digitalbitbox.enable = true;
132 to the configuration which is equivalent to adding this package to the udev.packages list.
135 The easiest way to use the digitalbitbox package in NixOS is by adding
137 programs.digitalbitbox.enable = true;
139 to the configuration which installs the package and enables the hardware module.
141 homepage = "https://digitalbitbox.com/";
142 license = licenses.mit;
143 maintainers = with maintainers; [
146 platforms = platforms.linux;