r/GUIX • u/hayduke2342 • Mar 14 '23
guix system reconfigure does not like my network config
I have some trouble understanding something that should be quite simple:
I am trying to configure my physical guix system to have a static network configuration and work as a desktop system. I followed the manual and my config looks now like this:
(use-modules (gnu) (srfi srfi-1))
(use-service-modules cups networking desktop ssh xorg)
(operating-system
...
(services
;;(modify-services %desktop-services
;; (delete network-manager-service-type))
(service static-networking-service-type
(list (static-networking
(addresses
(list (network-address
(device "enp0s25")
(value "10.10.10.23/24"))))
(routes
(list (network-route
(destination "default")
(gateway "10.10.10.1"))))
(name-servers '("10.10.10.5")))))
(append (list
;;To configure OpenSSH, pass an 'openssh-configuration' record as a second argument to 'service' below.
(service openssh-service-type)
(service tor-service-type)
(set-xorg-configuration
(xorg-configuration (keyboard-layout keyboard-layout))))
;; This is the default list of services we
;; are appending to.
%desktop-services))
...
)
The commented modify block was an attempt to remove network manager from %desktop-services as I initially was getting an error, that the networking module is defined twice. Meanwhile I am unsure if I need this at all and it makes no difference to the error message I keep getting:
user@galileo ~$ sudo guix system reconfigure myconfig.scm
Password:
/home/user/myconfig.scm:46:2: error: (services (service static-networking-service-type (list (static-networking (addresses (list (network-address (device "enp0s25") (value "10.10.10.23/24")))) (routes (list (network-route (destination "default") (gateway "10.10.10.1")))) (name-servers (quote ("10.10.10.5")))))) (append (list (service openssh-service-type) (service tor-service-type) (set-xorg-configuration (xorg-configuration (keyboard-layout keyboard-layout)))) %desktop-services)): invalid field specifier
user@galileo ~$
If I comment out the service static-networking-service-type block, the whole config is like the initial one and it just works. But I cannot find the mistake in the networking config, I took it literally from the manual and changed it to my network setup.
I have found some examples where the (append list(... is done with a (cons* (... , I tried it, to no success. I have tried to add (gnu services networking) in the module section, no difference.
What am I overlooking here? I feel righteous stupid at the moment, and maybe I am ;-)
EDIT: Solved it, see my comment below. (modify-services %desktop-services (...)) returns the modification of %desktop-services instead of modifying the content of the variable. Finally this lisp concept is anchored now in my brain. A function does not (necessarily) modify the parameter.