all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Writing an Accessible Guix ISO
@ 2023-05-07  7:50 Hunter Jozwiak
  2023-05-11 22:53 ` Fwd: " Hunter Jozwiak
  0 siblings, 1 reply; 3+ messages in thread
From: Hunter Jozwiak @ 2023-05-07  7:50 UTC (permalink / raw)
  To: help-guix


Greetings,

I have been hacking for quite some time now on the Guix installer, trying to get it to run with the espeakup screenreader which I have the module and package for in Guix already. Here is what I have managed to come up with thus far, after a time.
#+begin_src scheme :eval no
  (define-module (nongnu system install)
    #:use-module (gnu services)
    #:use-module (gnu services ssh)
    #:use-module (gnu services sound)
    #:use-module (gnu services configuration)
    #:use-module (gnu services linux)
    #:use-module (gnu services shepherd)
    #:use-module (guix gexp)
    #:use-module (guix records)
    #:use-module (gnu system)
    #:use-module (gnu system install)
    #:use-module (gnu packages accessibility)
  
    #:use-module (gnu packages version-control)
    #:use-module (gnu packages vim)
    #:use-module (gnu packages curl)
    #:use-module (gnu packages emacs)
    #:use-module (gnu packages linux)
    #:use-module (gnu packages mtools)
    #:use-module (gnu packages package-management)
    #:use-module (guix)
    #:export (installation-os-accessible))

  (define-configuration/no-serialization espeakup-configuration
    (espeakup
     (file-like espeakup)
     "Set the package providing the @code{/bin/espeakup} command.")
    (default-voice
      (string "en-US")
      "Set the voice that espeak-ng should use by default."))

  (define (espeakup-shepherd-service config)
    (list (shepherd-service
           (provision '(espeakup))
           (requirement '(user-processes))
           (documentation "Run espeakup, the espeak-ng bridge to speakup.")
           (start
            #~(make-forkexec-constructor
               (list #$(file-append (espeakup-configuration-espeakup config)
                                    "/bin/espeakup")
                     "-V" #$(espeakup-configuration-default-voice config))))
           (stop #~(make-kill-destructor)))))

  (define espeakup-service-type
    (service-type
     (name 'espeakup)
     (extensions
      (list (service-extension
             shepherd-root-service-type
             espeakup-shepherd-service)
            (service-extension
             kernel-module-loader-service-type
             (const (list "speakup_soft")))))
     (default-value (espeakup-configuration))
     (description
      "Configure and run espeakup, a lightweight bridge between espeak-ng and speakup.")))
  (define installation-os-accessible
    (operating-system
     (inherit installation-os)
     ;; Add the 'net.ifnames' argument to prevent network interfaces
     ;; from having really long names.  This can cause an issue with
     ;; wpa_supplicant when you try to connect to a wifi network.
     (kernel-arguments '("quiet" "modprobe.blacklist=radeon" "net.ifnames=0" "console=ttyS0,115200" "speakup.synth=soft"))

     (services
      (cons*
       ;;; Todo unmute all the audio channels.
       (service alsa-service-type)
       (service espeakup-service-type)
       (modify-services (operating-system-user-services installation-os)
                        (openssh-service-type config =>
                                              (openssh-configuration
                                               (inherit config)
                                               (allow-empty-passwords? #t)
                                               (%auto-start? #t))))))

     ;; Add some extra packages useful for the installation process
     (packages
      (append (list espeakup git curl stow vim emacs-no-x-toolkit alsa-utils)
              (operating-system-packages installation-os)))))

  installation-os-accessible
#+end_src
The main questions I have so far are these:
1. I know that the espeakup service is incomplete and when I was experimenting it was perpetually disabled. I have a reference of how it is done in systemd, but not sure how to translate it to the correct shepherd things; pointers to corrections appreciated (I suspect that the kernel-loader service is a modprobe of sorts, not sure how to solve for the sound requirement as yet).
   #+begin_src conf
     [Unit]
     Description=Software speech output for Speakup
     Documentation=man:espeakup(8)
     Wants=modprobe@speakup_soft.service
     After=modprobe@speakup_soft.service sound.target

     [Service]
     Type=forking
     PIDFile=/run/espeakup.pid
     Environment="default_voice="
     ExecStart=@bindir@/espeakup --default-voice=${default_voice}
     ExecReload=kill -HUP $MAINPID
     Restart=always
     Nice=-10
     OOMScoreAdjust=-900

     [Install]
     WantedBy=sound.target
   #+end_src
   As an update, I did manage to get espeakup to sort of enable itself with herd enable espeakup and I tried herd start espeakup, but nothing fruitful happened.

2. Is it true that the defaults is to mute all the channels by default, and if so how can this be undone? As it stands now, the system has everything muted when I run alsamixer and the volumes were all 0.

3. The ssh was meant more as a fail safe in case all else had failed,
and there was no audio to speak of; that and it has been somewhat
invaluable in debugging the system. In practical uses, this will likely
need to be shorn up and locked down again. In the case someone needs to
ssh into the box, is there a way to hijack the installer from an ssh session (the code spelunking I have done thus far suggests no, but I might be wrong)?


Thanks,

Hunter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Fwd: Writing an Accessible Guix ISO
  2023-05-07  7:50 Writing an Accessible Guix ISO Hunter Jozwiak
@ 2023-05-11 22:53 ` Hunter Jozwiak
  2023-05-14 13:58   ` Csepp
  0 siblings, 1 reply; 3+ messages in thread
From: Hunter Jozwiak @ 2023-05-11 22:53 UTC (permalink / raw)
  To: guix-devel

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

Howdy,

Here is a project I am interested in getting into Guix in some fashion,
copied from my email I sent to help-guix a while back. Any mentorship
and/or help pointers would be appreciated, and I appologize for the double
posting.

---------- Forwarded message ---------
From: Hunter Jozwiak <hunter.t.joz@gmail.com>
Date: Sun, May 7, 2023 at 3:50 AM
Subject: Writing an Accessible Guix ISO
To: <help-guix@gnu.org>


Greetings,

I have been hacking for quite some time now on the Guix installer, trying
to get it to run with the espeakup screenreader which I have the module and
package for in Guix already. Here is what I have managed to come up with
thus far, after a time.

(define-module (nongnu system install)
  #:use-module (gnu services)
  #:use-module (gnu services ssh)
  #:use-module (gnu services sound)
  #:use-module (gnu services configuration)
  #:use-module (gnu services linux)
  #:use-module (gnu services shepherd)
  #:use-module (guix gexp)
  #:use-module (guix records)
  #:use-module (gnu system)
  #:use-module (gnu system install)
  #:use-module (gnu packages accessibility)

  #:use-module (gnu packages version-control)
  #:use-module (gnu packages vim)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages mtools)
  #:use-module (gnu packages package-management)
  #:use-module (guix)
  #:export (installation-os-accessible))

(define-configuration/no-serialization espeakup-configuration
  (espeakup
   (file-like espeakup)
   "Set the package providing the @code{/bin/espeakup} command.")
  (default-voice
    (string "en-US")
    "Set the voice that espeak-ng should use by default."))

(define (espeakup-shepherd-service config)
  (list (shepherd-service
         (provision '(espeakup))
         (requirement '(user-processes))
         (documentation "Run espeakup, the espeak-ng bridge to speakup.")
         (start
          #~(make-forkexec-constructor
             (list #$(file-append (espeakup-configuration-espeakup config)
                                  "/bin/espeakup")
                   "-V" #$(espeakup-configuration-default-voice config))))
         (stop #~(make-kill-destructor)))))

(define espeakup-service-type
  (service-type
   (name 'espeakup)
   (extensions
    (list (service-extension
           shepherd-root-service-type
           espeakup-shepherd-service)
          (service-extension
           kernel-module-loader-service-type
           (const (list "speakup_soft")))))
   (default-value (espeakup-configuration))
   (description
    "Configure and run espeakup, a lightweight bridge between
espeak-ng and speakup.")))
(define installation-os-accessible
  (operating-system
   (inherit installation-os)
   ;; Add the 'net.ifnames' argument to prevent network interfaces
   ;; from having really long names.  This can cause an issue with
   ;; wpa_supplicant when you try to connect to a wifi network.
   (kernel-arguments '("quiet" "modprobe.blacklist=radeon"
"net.ifnames=0" "console=ttyS0,115200" "speakup.synth=soft"))

   (services
    (cons*
     ;;; Todo unmute all the audio channels.
     (service alsa-service-type)
     (service espeakup-service-type)
     (modify-services (operating-system-user-services installation-os)
                      (openssh-service-type config =>
                                            (openssh-configuration
                                             (inherit config)
                                             (allow-empty-passwords? #t)
                                             (%auto-start? #t))))))

   ;; Add some extra packages useful for the installation process
   (packages
    (append (list espeakup git curl stow vim emacs-no-x-toolkit alsa-utils)
            (operating-system-packages installation-os)))))

installation-os-accessible

The main questions I have so far are these:

   1.

   I know that the espeakup service is incomplete and when I was
   experimenting it was perpetually disabled. I have a reference of how it is
   done in systemd, but not sure how to translate it to the correct shepherd
   things; pointers to corrections appreciated (I suspect that the
   kernel-loader service is a modprobe of sorts, not sure how to solve for the
   sound requirement as yet).

   [Unit]
   Description=Software speech output for Speakup
   Documentation=man:espeakup(8)
   Wants=modprobe@speakup_soft.service
   After=modprobe@speakup_soft.service sound.target

   [Service]
   Type=forking
   PIDFile=/run/espeakup.pid
   Environment="default_voice="
   ExecStart=@bindir@/espeakup --default-voice=${default_voice}
   ExecReload=kill -HUP $MAINPID
   Restart=always
   Nice=-10
   OOMScoreAdjust=-900

   [Install]
   WantedBy=sound.target

   As an update, I did manage to get espeakup to sort of enable itself with
   herd enable espeakup and I tried herd start espeakup, but nothing fruitful
   happened.
   2. Is it true that the defaults is to mute all the channels by default,
   and if so how can this be undone? As it stands now, the system has
   everything muted when I run alsamixer and the volumes were all 0.
   3. The ssh was meant more as a fail safe in case all else had failed,

and there was no audio to speak of; that and it has been somewhat
invaluable in debugging the system. In practical uses, this will likely
need to be shorn up and locked down again. In the case someone needs to ssh
into the box, is there a way to hijack the installer from an ssh session
(the code spelunking I have done thus far suggests no, but I might be
wrong)?

Thanks,

Hunter

[-- Attachment #2: Type: text/html, Size: 6296 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fwd: Writing an Accessible Guix ISO
  2023-05-11 22:53 ` Fwd: " Hunter Jozwiak
@ 2023-05-14 13:58   ` Csepp
  0 siblings, 0 replies; 3+ messages in thread
From: Csepp @ 2023-05-14 13:58 UTC (permalink / raw)
  To: Hunter Jozwiak; +Cc: guix-devel


Hunter Jozwiak <hunter.t.joz@gmail.com> writes:

> Howdy,
>
> Here is a project I am interested in getting into Guix in some fashion, copied from my email I sent to help-guix a while back. Any mentorship
> and/or help pointers would be appreciated, and I appologize for the double posting.
>
> ---------- Forwarded message ---------
> From: Hunter Jozwiak <hunter.t.joz@gmail.com>
> Date: Sun, May 7, 2023 at 3:50 AM
> Subject: Writing an Accessible Guix ISO
> To: <help-guix@gnu.org>
>
> Greetings, 
>
> I have been hacking for quite some time now on the Guix installer, trying to get it to run with the espeakup screenreader which I have the
> module and package for in Guix already.

Hi!
Glad to see someone working on this!  I've been meaning to try my hands
at it, but having to mess close to the boot process again was
intimidating, so I kept putting it off.
I can't promise much coding help, but I'd be glad to test it out.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-14 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-07  7:50 Writing an Accessible Guix ISO Hunter Jozwiak
2023-05-11 22:53 ` Fwd: " Hunter Jozwiak
2023-05-14 13:58   ` Csepp

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.