(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)))