all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roman Scherer <roman@burningswell.com>
To: Nicolas Graves <ngraves@ngraves.fr>
Cc: Roman Scherer <roman@burningswell.com>,
	74120@debbugs.gnu.org, Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#74120] [PATCH] gnu: Add rust-speakersafetyd-1.
Date: Wed, 06 Nov 2024 18:15:04 +0100	[thread overview]
Message-ID: <86h68k8esn.fsf@burningswell.com> (raw)
In-Reply-To: <87cyjcxcv8.fsf@ngraves.fr> (Nicolas Graves's message of "Sun, 03 Nov 2024 21:48:27 +0100")

[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]

Nicolas Graves <ngraves@ngraves.fr> writes:

Hi Nicolas,

thanks for the review. I sent a v2 where I now use g-expressions and use
the install-data target from the Makefile to install files.

I tested this with this speakersafteyd service which I'm going to send
soon as well. I paste it here to maybe double check the paths I plan to
use in the service.

----------------------------------------------------------------------

(define-module (asahi guix services speakersafetyd)
  #:use-module (asahi guix packages crates-io)
  #:use-module (gnu services base)
  #:use-module (gnu services shepherd)
  #:use-module (gnu services)
  #:use-module (guix gexp)
  #:use-module (guix records)
  #:export (speakersafetyd-service-type))

(define-record-type* <speakersafetyd-configuration>
  speakersafetyd-configuration
  make-speakersafetyd-configuration
  speakersafetyd-configuration?
  (config-path speakersafetyd-configuration-config-path
               (default "/usr/share/speakersafetyd"))
  (blackbox speakersafetyd-configuration-blackbox
            (default "/var/lib/speakersafetyd/blackbox"))
  (max-reduction speakersafetyd-configuration-max-reduction
                 (default 7))
  (package speakersafetyd-configuration-package
           (default rust-speakersafetyd-1)))

(define (speakersafetyd-shepherd-service config)
  (let ((blackbox (speakersafetyd-configuration-blackbox config))
        (config-path (speakersafetyd-configuration-config-path config))
        (max-reduction (speakersafetyd-configuration-max-reduction config))
        (package (speakersafetyd-configuration-package config)))
    (list (shepherd-service
           (documentation "Speaker saftey daemon")
           (provision '(speakersafetyd))
           (requirement '(udev))
           (start #~(make-forkexec-constructor
                     (list #$(file-append package "/bin/speakersafetyd")
                           "--config-path" #$(file-append package config-path)
                           "--blackbox-path" #$blackbox
                           "--max-reduction" (number->string #$max-reduction))))
           (stop #~(make-kill-destructor))))))

(define speakersafetyd-service-type
  (service-type
   (name 'speakersafetyd)
   (description "Speaker saftey daemon")
   (extensions
    (list (service-extension
           profile-service-type
           (compose list speakersafetyd-configuration-package))
          (service-extension
           shepherd-root-service-type
           speakersafetyd-shepherd-service)
          (service-extension
           udev-service-type
           (compose list speakersafetyd-configuration-package))))
   (default-value (speakersafetyd-configuration))))

----------------------------------------------------------------------

Could you have another look, please?

Thanks, Roman.

> Hi Roman,
>
> Just so you know, you can probably use gexpressions for the phases, this
> would make it easier to read.
>
> Can you resend a revised patch?  Thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]

  reply	other threads:[~2024-11-06 17:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 19:41 [bug#74120] [PATCH] gnu: Add rust-speakersafetyd-1 Roman Scherer
2024-11-03 20:48 ` Nicolas Graves via Guix-patches via
2024-11-06 17:15   ` Roman Scherer [this message]
2024-11-06 17:08 ` [bug#74120] [PATCH v2] " Roman Scherer
2024-12-03 19:46   ` bug#74120: " Efraim Flashner
2024-12-04  7:55     ` [bug#74120] " Roman Scherer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86h68k8esn.fsf@burningswell.com \
    --to=roman@burningswell.com \
    --cc=74120@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.