2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2021-03-08 12:06:29 +00:00
|
|
|
, stdenv
|
2020-11-09 18:26:28 +00:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2024-03-10 22:35:21 +00:00
|
|
|
, fetchpatch
|
2020-11-09 18:26:28 +00:00
|
|
|
, trezor-udev-rules
|
2024-08-17 22:29:43 +00:00
|
|
|
, nixosTests
|
2021-03-08 12:06:29 +00:00
|
|
|
, AppKit
|
2020-11-09 18:26:28 +00:00
|
|
|
}:
|
2017-02-08 16:18:22 +00:00
|
|
|
|
2020-11-09 18:26:28 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "trezord-go";
|
2023-04-30 09:22:11 +00:00
|
|
|
version = "2.0.33";
|
|
|
|
commit = "2680d5e";
|
2017-02-08 16:18:22 +00:00
|
|
|
|
2018-04-10 22:12:32 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-03-08 12:50:40 +00:00
|
|
|
owner = "trezor";
|
|
|
|
repo = "trezord-go";
|
|
|
|
rev = "v${version}";
|
2022-11-06 00:09:42 +00:00
|
|
|
fetchSubmodules = true;
|
2024-07-14 10:59:26 +00:00
|
|
|
hash = "sha256-3I6NOzDMhzRyVSOURl7TjJ1Z0P0RcKrSs5rNaZ0Ho9M=";
|
2017-09-11 20:26:40 +00:00
|
|
|
};
|
|
|
|
|
2023-09-13 04:44:46 +00:00
|
|
|
vendorHash = "sha256-wXgAmZEXdM4FcMCQbAs+ydXshCAMu7nl/yVv/3sqaXE=";
|
2020-11-09 18:26:28 +00:00
|
|
|
|
2024-03-10 22:35:21 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/trezor/trezord-go/commit/616473d53a8ae49f1099e36ab05a2981a08fa606.patch";
|
|
|
|
hash = "sha256-yKTwgqWr4L6XEPV85A6D1wpRdpef8hkIbl4LrRmOyuo=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-08 12:06:29 +00:00
|
|
|
propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ trezor-udev-rules ]
|
2021-03-08 12:50:40 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit ];
|
2019-10-27 13:17:02 +00:00
|
|
|
|
2022-11-06 00:09:42 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X main.githash=${commit}"
|
|
|
|
];
|
|
|
|
|
2024-08-17 22:29:43 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) trezord; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-27 18:47:43 +00:00
|
|
|
description = "Trezor Communication Daemon aka Trezor Bridge";
|
2019-05-28 16:51:39 +00:00
|
|
|
homepage = "https://trezor.io";
|
2021-04-09 15:34:24 +00:00
|
|
|
license = licenses.lgpl3Only;
|
2020-07-29 10:57:20 +00:00
|
|
|
maintainers = with maintainers; [ canndrew jb55 prusnak mmahut _1000101 ];
|
2022-04-01 19:34:55 +00:00
|
|
|
mainProgram = "trezord-go";
|
2017-02-08 16:18:22 +00:00
|
|
|
};
|
|
|
|
}
|