lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 23.11-beta 148 lines 4.0 kB view raw
1{ mkDerivation 2, lib 3, autoreconfHook 4, curl 5, fetchFromGitHub 6, git 7, libevent 8, libtool 9, qrencode 10, udev 11, libusb1 12, makeWrapper 13, pkg-config 14, qtbase 15, qttools 16, qtwebsockets 17, qtmultimedia 18, udevRule51 ? '' 19, SUBSYSTEM=="usb", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbb%n", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402" 20, '' 21, udevRule52 ? '' 22, KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbbf%n" 23, '' 24, writeText 25}: 26 27# Enabling the digitalbitbox program 28# 29# programs.digitalbitbox.enable = true; 30# 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 33# NixOS. 34 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 39# 40# hardware.digitalbitbox.enable = true; 41# 42# or by adding the digitalbitbox package to system.udev.packages 43# 44# system.udev.packages = [ pkgs.digitalbitbox ]; 45 46# See https://digitalbitbox.com/start_linux for more information. 47let 48 copyUdevRuleToOutput = name: rule: 49 "cp ${writeText name rule} $out/etc/udev/rules.d/${name}"; 50in mkDerivation rec { 51 pname = "digitalbitbox"; 52 version = "3.0.0"; 53 54 src = fetchFromGitHub { 55 owner = "digitalbitbox"; 56 repo = "dbb-app"; 57 rev = "v${version}"; 58 sha256 = "ig3+TdYv277D9GVnkRSX6nc6D6qruUOw/IQdQCK6FoA="; 59 }; 60 61 nativeBuildInputs = with lib; [ 62 autoreconfHook 63 curl 64 git 65 makeWrapper 66 pkg-config 67 qttools 68 ]; 69 70 buildInputs = [ 71 libevent 72 libtool 73 udev 74 libusb1 75 qrencode 76 77 qtbase 78 qtwebsockets 79 qtmultimedia 80 ]; 81 82 LUPDATE="${qttools.dev}/bin/lupdate"; 83 LRELEASE="${qttools.dev}/bin/lrelease"; 84 MOC="${qtbase.dev}/bin/moc"; 85 QTDIR=qtbase.dev; 86 RCC="${qtbase.dev}/bin/rcc"; 87 UIC="${qtbase.dev}/bin/uic"; 88 89 configureFlags = [ 90 "--enable-libusb" 91 ]; 92 93 hardeningDisable = [ 94 "format" 95 ]; 96 97 qtWrapperArgs = [ "--prefix LD_LIBRARY_PATH : $out/lib" ]; 98 99 postInstall = '' 100 mkdir -p "$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 105 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} 110 ''; 111 112 # remove forbidden references to $TMPDIR 113 preFixup = '' 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" 117 fi 118 done 119 ''; 120 121 enableParallelBuilding = true; 122 123 meta = with lib; { 124 description = "A QT based application for the Digital Bitbox hardware wallet"; 125 longDescription = '' 126 Digital Bitbox provides dbb-app, a GUI tool, and dbb-cli, a CLI tool, to manage Digital Bitbox devices. 127 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 129 130 hardware.digitalbitbox.enable = true; 131 132 to the configuration which is equivalent to adding this package to the udev.packages list. 133 134 135 The easiest way to use the digitalbitbox package in NixOS is by adding 136 137 programs.digitalbitbox.enable = true; 138 139 to the configuration which installs the package and enables the hardware module. 140 ''; 141 homepage = "https://digitalbitbox.com/"; 142 license = licenses.mit; 143 maintainers = with maintainers; [ 144 vidbina 145 ]; 146 platforms = platforms.linux; 147 }; 148}