Guix System runs on Chromebooks just fine. The only problem is the usual problem with any GNU/Linux system: Audio does not work. There is a fix for audio on Chromebooks but it is so dependent on the conventional file system that I do not know how to implement the changes for Guix System. Does anybody know if they could make a system declaration that accomplishes what the script does?
Created chromebook-guix
to log my system changes. Got the following error:
caleb@hermes:~/Projects/chromebook-guix$ make
guix time-machine -C channels.scm -- system build system.scm
guix system: error: failed to load 'system.scm':
ice-9/boot-9.scm:3330:6: In procedure resolve-interface:
no code for module (chromebook alsa-lib)
make: *** [Makefile:9: build] Error 1
-
In order to use a module, you must first add it to the load path. GUILE_LOAD_PATH environment variable can be used for that.
-
In guile, each module name is derived from its file name:
(chromebook alsa-lib)
=chromebook/alsa-lib.scm
In your case, the module name and the file name do not match.
For the module to work, you need to add the directory in which your module is located to the load path. For example, if the module location is$HOME/Projects/chromebook-guix/chromebook/alsa-lib.scm
, you need to doexport GUILE_LOAD_PATH=$HOME/Projects/chromebook-guix
-
Instead of loading a module you can load a simple file:
(primitive-load "/path/to/file.scm")
Found some instructions for non-standard distros from the Chrultrabook people.
It seems to be building after changing GUILE_LOAD_PATH
but I’ll have to confirm in the morning. Good night.
caleb@hermes:~/Projects/chromebook-guix$ guix repl -L .
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guix-user)> (use-modules (chromebook alsa-lib))
scheme@(guix-user)>
Yet, I still get the error:
caleb@hermes:~/Projects/chromebook-guix$ make
guix time-machine -C channels.scm -L . -- system build system.scm
Updating channel 'nonguix' from Git repository at 'https://gitlab.com/nonguix/nonguix'...
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Authenticating channel 'guix', commits 9edb3f6 to 9f183c3 (25 new commits)...
error: channel: unbound variable
hint: Did you forget `(use-modules (guix channels))'?
error: specifications->manifest: unbound variable
hint: Did you forget `(use-modules (gnu packages))'?
no code for module (nongnu packages linux)
hint: File `./system.scm' should probably start with:
(define-module (system))
[...]
guix system: error: failed to load 'system.scm':
ice-9/boot-9.scm:3330:6: In procedure resolve-interface:
no code for module (chromebook alsa-lib)
make: *** [Makefile:9: build] Error 1
So, judging by the fact that it produces errors about channel
and specifications->manifest
, the directory is in the load path. But it is possible that the -L
option is only visible to time-machine
, but not to system
. That happened to me with --substitute-urls
. I think that options used in time-machine
are not passed to the command it calls. Try this:
guix time-machine -C channels.scm -- system -L . build system.scm
The module may also be broken. You need to check it separately:
guix build -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'
error: channel: unbound variable
hint: Did you forget `(use-modules (guix channels))'?
error: specifications->manifest: unbound variable
hint: Did you forget `(use-modules (gnu packages))'?
error: channel: unbound variable
hint: Did you forget `(use-modules (guix channels))'?
error: specifications->manifest: unbound variable
hint: Did you forget `(use-modules (gnu packages))'?
guix system: warning: failed to load '(system)':
no code for module (system)
hint: File `./system.scm' should probably start with:
(define-module (system))
guix system: error: chromebook-alsa-lib: unknown package
guix system: warning: failed to load '(system)':
guix system: error: failed to load 'system.scm':
guix/ui.scm:478:5: In procedure warn-about-load-error:
Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)>
make: *** [Makefile:9: build] Error 1
caleb@hermes:~/Projects/chromebook-guix$ guix build -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'
guix build: error: failed to evaluate expression '(@ (chromebook alsa-lib) chromebook-alsa-lib)':
In procedure module-variable: Wrong type argument in position 1 (expecting module): #f
Alright, I tried that myself.
guix build -L . -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'
is built successfully for me.
As for system.scm, specification->package
cannot detect your package because its definition is missing (name "chromebook-alsa-lib")
. However, I built it without specification->package
:
(packages (cons* chromebook-alsa-lib
%base-packages))
The command I used:
guix time-machine -C channels.scm -- system -L . build system.scm
This builds here, too!
I removed specification->package
and will try building it tonight, and report back.
Don’t forget to add the package name field for chromebook-alsa-lib. Although the package can be built without it, it should be there anyway, even if you don’t use specification->package.
The system built! I rebooted. Sound still doesn’t work.
Add package name field. Like this?
29 (define-public chromebook-ucm-conf
30 (let ((commit "1328e46bfca6db2c609df9c68d37bb418e6fe279")
31 (revision "1"))
32 (package
33 (name "chromebook-ucm-conf")
34 (version (git-version "0.0" revision commit))
35 (source (origin
It was already there in line 33.
The name is missing not from chromebook-ucm-conf, but from chromebook-alsa-lib
Done. Should I return specification->package
to (packages)
now?
(packages (append (list (specification->package "chromebook-alsa-lib"))
%base-packages))
I thought chromebook-alsa-lib
was not named, because it was supposed to totally replace alsa-lib
. Having two alsa-lib
s might mean that the audio settings for chromebook-alsa-lib
are not recognized by the system.
You can use specification->package
if you want. But I think it makes no sense in this case. specification->manifest
is usually used when the module from which the package is taken is not known. You have explicitly specified the module.
Also, my bad, I didn’t notice the package inheritance. So (name "chromebook-alsa-lib")
can actually be removed.
And that’s why specification->package
didn’t work last time. You had:
(specification->package "chromebook-alsa-lib")
but the name of the inherited package was :
(name "alsa-lib")
So you need to write either:
(packages (cons* chromebook-alsa-lib
%base-packages))
or:
(packages (cons* (specifiastion->package "alsa-lib")
%base-packages))
The first option is better in my opinion.
OK, removed the line.
Now that it builds, I wonder what is needed to get audio working.