[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hurd-vm-service-type into /etc/config.scm
From: |
address@hidden |
Subject: |
Re: hurd-vm-service-type into /etc/config.scm |
Date: |
Wed, 20 Mar 2024 10:55:45 +0100 |
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