diff options
author | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2024-06-08 14:23:48 +0200 |
---|---|---|
committer | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2024-06-09 13:37:58 +0200 |
commit | bb7fbf939e49dc6fcd4f8b20be9e17e88a0abe60 (patch) | |
tree | 6be0c0c14a6c3ca18fef1f6fe6ba3ce6acc8aaec /suweren/trezor.scm | |
parent | 14aca4d63fc2408adf2e58c25032e28774bf6a16 (diff) |
implement trezor-bridge
Diffstat (limited to 'suweren/trezor.scm')
-rw-r--r-- | suweren/trezor.scm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/suweren/trezor.scm b/suweren/trezor.scm new file mode 100644 index 0000000..76643ea --- /dev/null +++ b/suweren/trezor.scm @@ -0,0 +1,35 @@ +(define-module (suweren trezor) + #:use-module (gnu packages finance) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services shepherd) + #:use-module (guix gexp)) + +(define-public trezor-bridge + (let* ((service-executable (file-append trezord + "/bin/trezord-go")) + + (start-command #~ (list #$ service-executable)) + + (shepherd-symbols (list 'trezor-bridge)) + (start-process #~ (make-forkexec-constructor #$ start-command)) + (stop-process #~ (make-kill-destructor)) + + (profile-extension (list trezord)) + (shepherd-extension (shepherd-service (provision shepherd-symbols) + (start start-process) + (stop stop-process))) + + (shepherd-extension* (list shepherd-extension)) + + (profile-service (simple-service 'trezor-bridge-profile + profile-service-type + profile-extension)) + (shepherd-service (simple-service 'trezor-bridge-shepherd + shepherd-root-service-type + shepherd-extension*)) + (udev-service (udev-rules-service 'trezor-bridge-udev + trezord-udev-rules))) + (list profile-service + udev-service + shepherd-service))) |