From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: Re: guix system reconfigure: Wrong type argument in position 1 (expecting struct) Date: Tue, 18 Jun 2019 18:19:51 +0200 Message-ID: <20190618181946.4cc559bf@tachikoma.lepiller.eu> References: <877e9j9c74.fsf@roquette.mug.biscuolo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50732) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdGqT-0006xg-LD for help-guix@gnu.org; Tue, 18 Jun 2019 12:20:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdGqQ-0003Cv-R2 for help-guix@gnu.org; Tue, 18 Jun 2019 12:20:29 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:52592) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdGqQ-0005rD-93 for help-guix@gnu.org; Tue, 18 Jun 2019 12:20:26 -0400 In-Reply-To: <877e9j9c74.fsf@roquette.mug.biscuolo.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Giovanni Biscuolo Cc: help-guix@gnu.org Le Tue, 18 Jun 2019 16:53:51 +0200, Giovanni Biscuolo a =C3=A9crit : > Hello Guix, >=20 > I'm trying to reconfigure but I get this error: >=20 > Since everytime I try to purposely add a syntax error or miss to add a > module guix correctly point that out, I doubt it depends on some error > in my config.scm... or am I wrong? >=20 > Anyway, this is my slightly obfuscated config.scm: >=20 > --8<---------------cut here---------------start------------->8--- > ; This is batondor >=20 > (use-modules (gnu)) > (use-service-modules networking ssh mcron virtualization) > (use-package-modules linux) >=20 > (define %authorized-guix-keys > ;; List of authorized 'guix archive' keys. > (list (local-file "keys/guix/OMISSIS.pub") > (local-file "keys/guix/OMISSIS.pub"))) >=20 > (define gc-job > ;; Run 'guix gc' at 3AM every day. > #~(job '(next-hour '(3)) "guix gc -F 50G")) >=20 > (define btrfs-job > ;; Run 'btrfs balance' every three days to make free space. > #~(job (lambda (now) > (next-day-from now (range 1 31 3))) > (string-append #$btrfs-progs "/bin/btrfs balance " > "start -dusage=3D50 -musage=3D70 /"))) >=20 > ;; The actual machine >=20 > (operating-system > (locale "en_US.utf8") > (timezone "Europe/Rome") > (keyboard-layout > (keyboard-layout "it" "nodeadkeys")) > (bootloader > (bootloader-configuration > (bootloader grub-efi-bootloader) > (target "/boot/efi") > (keyboard-layout keyboard-layout))) > (file-systems > (cons* (file-system > (mount-point "/") > (device > (uuid "26bd54ec-4e74-4b3a-96ff-58f2f34e4a1a" > 'btrfs)) > (type "btrfs")) > (file-system > (mount-point "/boot/efi") > (device (uuid "7A61-DB20" 'fat32)) > (type "vfat")) > %base-file-systems)) > (host-name "batondor") > (users (cons* (user-account > (name "x") > (comment "XXXXXXXXXXXXXXXXX") > (group "users") > (home-directory "/home/x") > (supplementary-groups > '("wheel" "kvm" "netdev" "audio" "video"))) > %base-user-accounts)) > (packages > (append > (list (specification->package "nss-certs")) > %base-packages)) >=20 > (services > (append > (list (service openssh-service-type > (openssh-configuration > (port-number 22) > (authorized-keys > `(("x" ,(local-file "keys/ssh/x.pub")))))) >=20 > (service dhcp-client-service-type) >=20 > (service ntp-service-type) >=20 > (service qemu-binfmt-service-type > (qemu-binfmt-configuration > (platforms (lookup-qemu-platforms "arm" "aarch64")) > (guix-support? #t))) >=20 > (service mcron-service-type > (mcron-configuration > (jobs (list gc-job btrfs-job)))) >=20 > (modify-services %base-services > (guix-service-type config =3D> > (guix-configuration > (inherit config) > (use-substitutes? #t) > (authorized-keys > %authorized-guix-keys)))))))) > --8<---------------cut here---------------end--------------->8--- The result of modify-services is a list, but reading your file, it seems you add it to the end of the (list ...) thing, which is not going to work: you're ending up with a list of lists. You can either put the modify-services form outside of that list: (service mcron-service-type (mcron-configuration - (jobs (list gc-job btrfs-job)))) + (jobs (list gc-job btrfs-job))))) (modify-services %base-services (guix-service-type config =3D> (guix-configuration (inherit config) (use-substitutes? #t) (authorized-keys - %authorized-guix-keys)))))))) + %authorized-guix-keys))))))) or replace the (append (list ...)) with a (cons* ...): (services - (append - (list (service openssh-service-type + (cons* (service openssh-service-type - %authorized-guix-keys)))))))) + %authorized-guix-keys))))))) >=20 > Am I missing something or did I found a bug? >=20 > Thanks! Gio'. >=20