summary refs log tree commit diff
path: root/nixos/modules/services/hardware/trezord.nix
diff options
context:
space:
mode:
authorMarek Mahut <marek.mahut@gmail.com>2019-08-16 16:58:48 +0200
committerMarek Mahut <marek.mahut@gmail.com>2019-08-16 16:58:48 +0200
commit5712bea91b1b5f01859a870c212ec520d644dc63 (patch)
tree3b892aaf507bc746b878f8a22a87ea5a0acce6bd /nixos/modules/services/hardware/trezord.nix
parent53e8129017924d90287cb8cef2c2b05f323080a0 (diff)
downloadnixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.tar
nixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.tar.gz
nixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.tar.bz2
nixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.tar.lz
nixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.tar.xz
nixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.tar.zst
nixpkgs-5712bea91b1b5f01859a870c212ec520d644dc63.zip
trezord: adding emultor support
Diffstat (limited to 'nixos/modules/services/hardware/trezord.nix')
-rw-r--r--nixos/modules/services/hardware/trezord.nix18
1 files changed, 17 insertions, 1 deletions
diff --git a/nixos/modules/services/hardware/trezord.nix b/nixos/modules/services/hardware/trezord.nix
index c06a0665d02..bb55cc2a9ad 100644
--- a/nixos/modules/services/hardware/trezord.nix
+++ b/nixos/modules/services/hardware/trezord.nix
@@ -16,6 +16,22 @@ in {
           Enable Trezor bridge daemon, for use with Trezor hardware bitcoin wallets.
         '';
       };
+
+      emulator.enable = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Enable Trezor emulator support.
+          '';
+       };
+
+      emulator.port = mkOption {
+        type = types.port;
+        default = 21324;
+        description = ''
+          Listening port for the Trezor emulator.
+          '';
+      };
     };
   };
   
@@ -44,7 +60,7 @@ in {
       path = [];
       serviceConfig = {
         Type = "simple";
-        ExecStart = "${pkgs.trezord}/bin/trezord-go";
+        ExecStart = "${pkgs.trezord}/bin/trezord-go ${optionalString cfg.emulator.enable "-e ${builtins.toString cfg.emulator.port}"}";
         User = "trezord";
       };
     };