8 cfg = config.services.trezord;
22 enable = lib.mkOption {
23 type = lib.types.bool;
26 Enable Trezor bridge daemon, for use with Trezor hardware bitcoin wallets.
30 emulator.enable = lib.mkOption {
31 type = lib.types.bool;
34 Enable Trezor emulator support.
38 emulator.port = lib.mkOption {
39 type = lib.types.port;
42 Listening port for the Trezor emulator.
50 config = lib.mkIf cfg.enable {
51 services.udev.packages = [ pkgs.trezor-udev-rules ];
53 systemd.services.trezord = {
54 description = "Trezor Bridge";
55 after = [ "network.target" ];
56 wantedBy = [ "multi-user.target" ];
60 ExecStart = "${pkgs.trezord}/bin/trezord-go ${lib.optionalString cfg.emulator.enable "-e ${builtins.toString cfg.emulator.port}"}";
65 users.users.trezord = {
67 description = "Trezor bridge daemon user";
71 users.groups.trezord = { };