unofficial mirror of 
 help / color / mirror / Atom feed
From: Caleb Herbert <>
Subject: chromebook-ucm-conf
Date: Mon, 20 Nov 2023 12:28:36 -0600	[thread overview]
Message-ID: <> (raw)

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

Hi Guix,

Can anyone help me get my audio working?

I've been trying to "install" some configuration files for my audio 
setup on a Chromebook. On a normal GNU/Linux system, one installs them 
under /usr/share, but Guix doesn't have that, so I made a package based 
on alsa-ucm-conf.

But packaging the config files is not enough, it seems. You also have to 
modify alsa-lib, which efraim was kind enough to do last night.

But apparently, alsa-lib needs updated to support certain features of 
the config, so the attached Scheme code will not work. Can someone show 
me how to get it to work?


Caleb Herbert

[-- Attachment #2: chromebook-alsa-lib.scm --]
[-- Type: text/x-scheme, Size: 4010 bytes --]

;; chromebook-alsa-lib.scm - Install Chromebook ALSA config
;; Copyright (C) 2023  Caleb Herbert <>
;; Copyright (C) 2023  efraim
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <>.

(use-modules (guix packages)
             (guix utils)
             (guix git-download)
             (guix build-system copy)
             (guix build-system trivial)
             ((guix licenses) #:prefix license:)
             (gnu packages linux))

(define-public chromebook-ucm-conf
  (let ((commit "1328e46bfca6db2c609df9c68d37bb418e6fe279")
        (revision "1"))
      (name "chromebook-ucm-conf")
      (version (git-version "0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                       (url (string-append ""
                       (commit commit)))
                (file-name (git-file-name name version))
      (build-system copy-build-system)
         '(("glk" "share/alsa/ucm2/conf.d")
           ("common" "share/alsa/ucm2"))))
      (home-page "")
      (synopsis "Alsa UCM configuration for chrome devices")
       "A collection of modified ChromeOS UCM configuration files optimized
for mainline Linux")
      (license license:bsd-3))))

(define alsa-bonus-inputs
    (name "alsa-bonus-inputs")
    (version (package-version alsa-lib))
    (source #f)
    (build-system trivial-build-system)
     `(#:modules ((guix build union))
         (use-modules (ice-9 match)
                      (guix build union))
         (match %build-inputs
           (((names . directories) ...)
            (union-build (assoc-ref %outputs "out")
     (list alsa-ucm-conf alsa-topology-conf chromebook-ucm-conf))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define chromebook-alsa-lib
    (inherit alsa-lib)
     (substitute-keyword-arguments (package-arguments alsa-lib)
       ((#:phases phases)
        `(modify-phases ,phases
           (replace 'pre-install
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((alsa (string-append
                              (assoc-ref outputs "out") "/share/alsa"))
                     (bonus-inputs (assoc-ref inputs "alsa-bonus-inputs"))
                     (ucm (string-append bonus-inputs "/share/alsa/ucm"))
                     (ucm2 (string-append bonus-inputs "/share/alsa/ucm2"))
                     (topology (string-append
                                 bonus-inputs "/share/alsa/topology")))
                 (mkdir-p alsa)
                 (symlink ucm (string-append alsa "/ucm"))
                 (symlink ucm2 (string-append alsa "/ucm2"))
                 (symlink topology (string-append alsa "/topology")))))))))
     (modify-inputs (package-inputs alsa-lib)
                    (prepend alsa-bonus-inputs)
                    (delete "alsa-ucm-conf" "alsa-topology-conf")))))


             reply	other threads:[~2023-11-20 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 18:28 Caleb Herbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-02 18:12 chromebook-ucm-conf Caleb Herbert

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:

  List information:

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

  git send-email \ \ \ \

* 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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).