mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 13:28:16 +00:00
Merge pull request #725 from mitchmindtree/trezord
This commit is contained in:
commit
c7ae5dc969
2 changed files with 48 additions and 0 deletions
|
@ -82,6 +82,7 @@
|
||||||
./services/synapse-bt.nix
|
./services/synapse-bt.nix
|
||||||
./services/synergy
|
./services/synergy
|
||||||
./services/tailscale.nix
|
./services/tailscale.nix
|
||||||
|
./services/trezord.nix
|
||||||
./services/wg-quick.nix
|
./services/wg-quick.nix
|
||||||
./services/yabai
|
./services/yabai
|
||||||
./services/nextdns
|
./services/nextdns
|
||||||
|
|
47
modules/services/trezord.nix
Normal file
47
modules/services/trezord.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.trezord;
|
||||||
|
in {
|
||||||
|
# Options copied from:
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/9d6e454b857fb472fa35fc8b098fa5ac307a0d7d/nixos/modules/services/hardware/trezord.nix#L16
|
||||||
|
options = {
|
||||||
|
services.trezord = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Enable Trezor bridge daemon, for use with Trezor hardware wallets.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
emulator.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Enable Trezor emulator support.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
emulator.port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 21324;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Listening port for the Trezor emulator.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
launchd.user.agents.trezord = {
|
||||||
|
serviceConfig = {
|
||||||
|
ProgramArguments = [ "${pkgs.trezord}/bin/trezord-go" ]
|
||||||
|
++ optionals cfg.emulator.enable [ "-e" (builtins.toString cfg.emulator.port) ];
|
||||||
|
KeepAlive = true;
|
||||||
|
RunAtLoad = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue