all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hunter Jozwiak <hunter.t.joz@gmail.com>
To: help-guix@gnu.org
Subject: Writing an Accessible Guix ISO
Date: Sun, 07 May 2023 03:50:39 -0400	[thread overview]
Message-ID: <87r0rsd1gw.fsf@gmail.com> (raw)


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

             reply	other threads:[~2023-05-07 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07  7:50 Hunter Jozwiak [this message]
2023-05-11 22:53 ` Fwd: Writing an Accessible Guix ISO Hunter Jozwiak
2023-05-14 13:58   ` Csepp

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=87r0rsd1gw.fsf@gmail.com \
    --to=hunter.t.joz@gmail.com \
    --cc=help-guix@gnu.org \
    /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.