mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
Merge pull request #66722 from mmahut/trezord-emulator
trezord: adding emulator support (plus test)
This commit is contained in:
commit
f4ca6e3dd1
|
@ -22,6 +22,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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -50,7 +66,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";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -262,6 +262,7 @@ in
|
|||
tinydns = handleTest ./tinydns.nix {};
|
||||
tor = handleTest ./tor.nix {};
|
||||
transmission = handleTest ./transmission.nix {};
|
||||
trezord = handleTest ./trezord.nix {};
|
||||
udisks2 = handleTest ./udisks2.nix {};
|
||||
upnp = handleTest ./upnp.nix {};
|
||||
uwsgi = handleTest ./uwsgi.nix {};
|
||||
|
|
20
nixos/tests/trezord.nix
Normal file
20
nixos/tests/trezord.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
import ./make-test.nix ({ pkgs, ... }: {
|
||||
name = "trezord";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ mmahut ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
machine = { ... }: {
|
||||
services.trezord.enable = true;
|
||||
services.trezord.emulator.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
startAll;
|
||||
$machine->waitForUnit("trezord.service");
|
||||
$machine->waitForOpenPort(21325);
|
||||
$machine->waitUntilSucceeds("curl -L http://localhost:21325/status/ | grep Version");
|
||||
'';
|
||||
})
|
Loading…
Reference in a new issue