From: "hubert.lombard@ik.me" via <help-guix@gnu.org>
To: Saku Laesvuori <saku@laesvuori.fi>
Cc: "hubert.lombard@ik.me\" via" <help-guix@gnu.org>,
Richard Sent <richard@freakingpenguin.com>
Subject: Re: hurd-vm-service-type into /etc/config.scm
Date: Wed, 27 Mar 2024 11:21:11 +0100 [thread overview]
Message-ID: <b0b3867e520c414370052df40a36896e@mail.infomaniak.com> (raw)
In-Reply-To: <dac80267e08229be7a22e4e3aa212a20@mail.infomaniak.com>
Hello o/
Further investigations to insert
the hurd-vm in /etc/config.scm
In my attempt at config.scm, inspired both by my own file
and from examples found on the Internet, I've
tried to use (define %my-gnome as well and
(modify-services %desktop-services, knowing that I'm missing
at least 1 module related to the package list. I've
tried several, but I can't figure out which one (or
which...)
$ sudo guix system reconfigure /etc/config.scm
--8<---------------cut here---------------start------------->8---
ce-9/eval.scm:223:20: In procedure proc:
erreur : packages : variable non liée
conseil : Auriez-vous oublié un `use-modules' ?
--8<---------------cut here---------------end--------------->8---
As I only use Guix System, I'm aware that I'd better build myself a
a virtual machine to test this kind of configuration.
Secondly, I'm also aware that even if my
(use-modules) field was satisfied, there might still be other
problems...
Here's the failing test, what do you think?
/etc/config.scm
--8<---------------cut here---------------start------------->8---
(use-modules (gnu) (gnu services) (gnu services base)
(gnu packages gnome) (gnu packages) (gnu packages base)
(gnu system nss) (guix utils) (gnu services cups)
(gnu packages certs)) ;;Maybe some modules not relevant here ?...
(use-service-modules desktop networking ssh xorg cups
virtualization sound)
(use-package-modules bootloaders certs cups gnome xorg linux vim
scanner screen ssh wm audio)
(operating-system
(locale "fr_FR.utf8")
(timezone "Europe/Paris")
(keyboard-layout (keyboard-layout "fr"))
(host-name "gnu")
(users (cons* (user-account
(name "hubert")
(comment "Hubert")
(group "users")
(home-directory "/home/hubert")
(supplementary-groups '("wheel"
"netdev"
"audio" "video"
"kvm" "lp"
"cdrom" "scanner")))
%base-user-accounts))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(swap-devices (list (swap-space
(target (uuid
"527ab16b-d20c-4269-bc6f-8910ef3f8c5e")))))
(file-systems (cons* (file-system
(mount-point
"/boot/efi")
(device (uuid
"1C82-1420"
'fat32))
(type "vfat"))
(file-system
(mount-point "/")
(device (uuid
"e4fb3e05-b455-40db-bc59-4d4d011e1e01"
'ext4))
(type "ext4"))
%base-file-systems)))
(packages
(append
(list
nss-certs ;for HTTPS access
vim ;some tools expect it to be there
gvfs ;for user mounts
openssh
cups
foomatic-filters
hplip
sane-backends
ijs
ghostscript)
%base-packages))
(define %my-gnome
(package
(inherit gnome)
(name "my-gnome")
(propagated-inputs
(modify-inputs (package-propagated-inputs gnome)
(delete "epiphany")
(delete "evolution")
(delete "gnome-weather")
(delete "simple-scan")
(delete "gnome-maps")
(delete "gnome-boxes")
(delete "gnome-console")
(delete "gnome-contacts")
(append gnome-terminal))))
%my-gnome)
;; default settings
(services (append
(list
(service hurd-vm-service-type
(hurd-vm-configuration
(disk-size (* 5000 (expt
2 20)))
(memory-size
1024)))
(service gnome-desktop-service-type
(gnome-configuration
(gnome my-gnome)))
(service bluetooth-service-type
(bluetooth-configuration
(auto-enable? #t)))
(cups-configuration
(web-interface? #t)
(extensions
(list cups-filters
hplip)))
(set-xorg-configuration
(xorg-configuration ;set keyboard-layout for
Xorg
(keyboard-layout keyboard-layout)))
(modify-services %desktop-services
(service
cups-service-type
(cups-configuration
(web-interface? #t)
(extensions
(list cups-filters
hplip)))))
%default-settings)))
--8<---------------cut here---------------end--------------->8---
Thank you in advance if you can point me to a way :)
Best regards
Hubert
Le 2024-03-20T10:55:45.000+01:00, "hubert.lombard@ik.me" via
<help-guix@gnu.org> a écrit :
> Hi, Saku!
>
> Le 2024-03-19T08:37:47.000+01:00, Saku Laesvuori <saku@laesvuori.fi> a
>
> écrit :
>
>> On Mon, Mar 18, 2024 at 03:52:44PM +0100, hubert.lombard@ik.me
>> via wrote:
>>
>>> Hi Richard !
>>>
>>> Le 2024-03-16T16:07:29.000+01:00, Richard Sent
>>>
>>> <richard@freakingpenguin.com> a écrit :
>>>
>>>> Hubert,
>>>>
>>>> Your issue is in your operating-system services field. In the
>>>>
>>>> backtrace:
>>>>
>>>> --8<---------------cut
>>>>
>>>> here---------------start------------->8---
>>>>
>>>> In procedure append: Wrong type argument in position 2
>>>>
>>>> (expecting
>>>>
>>>> empty list) #<<service> type: #<service-type bluetooth ...
>>>>
>>>> --8<---------------cut
>>>>
>>>> here---------------end--------------->8---
>>>>
>>>> You have several services outside of the (list) call, so
>>>> you're
>>>>
>>>> basically running
>>>>
>>>> --8<---------------cut
>>>>
>>>> here---------------start------------->8---
>>>>
>>>> (append (list (service-1 service-2) service-3 service-4
>>>>
>>>> %desktop-services))
>>>>
>>>> --8<---------------cut
>>>>
>>>> here---------------end--------------->8---
>>>>
>>>> Append only takes lists as arguments. %desktop-services is a
>>>>
>>>> list, but
>>>>
>>>> bluetooth service and hurd-vm service are not.
>>>
>>> Thank you :) while/after reading your answer, I have tried to
>>>
>>> change
>>>
>>> my config file
>>>
>>> by adding %base-services like it :
>>>
>>> /etc/config.scm
>>>
>>> --8<---------------cut
>>> here---------------start------------->8---
>>>
>>> (services
>>>
>>> (append (list (service gnome-desktop-service-type)
>>>
>>> (service cups-service-type)
>>>
>>> (set-xorg-configuration
>>>
>>> (xorg-configuration
>>>
>>> (keyboard-layout keyboard-layout))))
>>>
>>> ;; Voici la liste des services par défaut à laquelle nous
>>>
>>> ;; ajoutons nos propres services.
>>>
>>> %desktop-services))
>>>
>>> (services (cons* (service bluetooth-service-type)
>>>
>>> (bluetooth-configuration
>>>
>>> (auto-enable? #t)))
>>>
>>> (service hurd-vm-service-type
>>>
>>> (hurd-vm-configuration
>>>
>>> (disk-size (* 10000 (expt 2 20))) ;10G
>>>
>>> (memory-size 1024))) ;1024MiB
>>>
>>> %base-services))
>>>
>>> --8<---------------cut
>>> here---------------end--------------->8---
>>
>> (Indentation modified to show the actual structure more clearly)
>
> Nice :)
>
>> The S-exp structure is wrong here. A service declaration is of
>> form
>>
>> ```
>>
>> (service xxx-service-type
>>
>> (xxx-configuration
>>
>> (field-name value)
>>
>> (another-field another-value)))
>
> Ok
>
>> ```
>>
>> and the `services` field must be a list of such service
>> declarations. In
>>
>> your configuration snippet the first definition of `services` is
>> valid
>>
>> but the second one is three separate elements (not a list). The
>> first
>>
>> element is a pair (not a list) with elements `(service
>> bluetooth-service-type)`
>>
>> and `(bluetooth-configuration (auto-enable? #t))`, the second
>> element is
>>
>> a single valid service declaration and the third is a list of
>> service
>>
>> declarations.
>
> Ah... I can see indeed.
>
>> Also, you are defining the `services` field twice which will not
>> give
>>
>> expected results even if it passes the compiler (hopefully it
>> doesn't).
>>
>> You have to combine the lists and set the `services` field to
>> that.
>
> Again, I understand better now. In this case, the reconfiguration
>
> hasn't even begun.
>
>> I think %base-services is a subset of %desktop-services, so you
>> should
>>
>> not need both in the same `operating-system` declaration.
>
> Got it.
>
>>> Instead of putting the Hurd in %base-services (arbitrarily
>>>
>>> inserted by
>>>
>>> myself), maybe I should create a service like
>>> %define-my-service,
>>>
>>> or
>>>
>>> use (modify-services.
>>
>> In Guix one doesn't "put services into %base-services" but
>> instead
>>
>> creates a new list of services which contains the services in
>>
>> %base-services and some additional services.
>
> This is what I tried to understand to implement yesterday by
> studying:
>
> (define %my-services
>
> (modify-services %xxxx-services
>
> (..........
>
>
>
> But I admit that it's still a bit fuzzy for me...
>
> A good thing is that by studying all of this a little bit yesterday,
> I
>
> was able to make it work Bluetooth :)
>
> --8<---------------cut here---------------start------------->8---
>
> (use-modules (gnu) (gnu services base))
>
> (use-service-modules cups desktop networking ssh xorg audio sound
> dbus
>
> virtualization)
>
> (operating-system
>
> (locale "fr_FR.utf8")
>
> (timezone "Europe/Paris")
>
> (keyboard-layout (keyboard-layout "fr"))
>
> (host-name "gnu")
>
> (users (cons* (user-account
>
> (name "hubert")
>
> (comment "Hubert")
>
> (group "users")
>
> (home-directory "/home/hubert")
>
> (supplementary-groups '("wheel"
>
> "netdev" "audio" "video" "kvm" "lp")))
>
> %base-user-accounts))
>
> (packages (append (list (specification->package "nss-certs"))
>
> %base-packages))
>
> (services
>
> (append (list (service gnome-desktop-service-type)
>
> (service bluetooth-service-type
>
> (bluetooth-configuration
>
> (auto-enable? #t)))
>
> (service cups-service-type)
>
> (set-xorg-configuration
>
> (xorg-configuration
>
> (keyboard-layout keyboard-layout))))
>
> %desktop-services))
>
> ........
>
> --8<---------------cut here---------------end--------------->8---
>
> I think I'll be able to insert (service hurd-vm-service-type in a
>
> definition of services :
>
> (define %my-services
>
> (modify-services %xxxx-services
>
> (..........
>
>
>
> I'm still studying... Thank you Saku for your reply o/
>
> Hubert
Envoyé depuis Infomaniak [https://www.infomaniak.com], email gratuit
et respectueux de la vie privée
next prev parent reply other threads:[~2024-03-27 10:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 18:33 hurd-vm-service-type into /etc/config.scm hubert.lombard@ik.me via
2024-03-16 15:07 ` Richard Sent
2024-03-18 14:52 ` hubert.lombard@ik.me via
2024-03-19 7:37 ` Saku Laesvuori
2024-03-20 9:55 ` hubert.lombard@ik.me via
2024-03-27 10:21 ` hubert.lombard@ik.me via [this message]
2024-03-28 6:58 ` Saku Laesvuori
[not found] ` <10aacff482f8f87b3cbff2b645758e9c@mail.infomaniak.com>
2024-03-30 20:25 ` hubert.lombard@ik.me via
2024-04-09 9:01 ` Saku Laesvuori
2024-04-10 21:08 ` hubert.lombard
2024-04-11 5:50 ` Saku Laesvuori
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=b0b3867e520c414370052df40a36896e@mail.infomaniak.com \
--to=help-guix@gnu.org \
--cc=hubert.lombard@ik.me \
--cc=richard@freakingpenguin.com \
--cc=saku@laesvuori.fi \
/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.