1 { config, lib, pkgs, ... }:
5 cfg = config.services.trezord;
21 description = lib.mdDoc ''
22 Enable Trezor bridge daemon, for use with Trezor hardware bitcoin wallets.
26 emulator.enable = mkOption {
29 description = lib.mdDoc ''
30 Enable Trezor emulator support.
34 emulator.port = mkOption {
37 description = lib.mdDoc ''
38 Listening port for the Trezor emulator.
46 config = mkIf cfg.enable {
47 services.udev.packages = [ pkgs.trezor-udev-rules ];
49 systemd.services.trezord = {
50 description = "Trezor Bridge";
51 after = [ "network.target" ];
52 wantedBy = [ "multi-user.target" ];
56 ExecStart = "${pkgs.trezord}/bin/trezord-go ${optionalString cfg.emulator.enable "-e ${builtins.toString cfg.emulator.port}"}";
61 users.users.trezord = {
63 description = "Trezor bridge daemon user";
67 users.groups.trezord = {};