[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guix system reconfigure: Wrong type argument in position 1 (expectin
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 |
Le Tue, 18 Jun 2019 16:53:51 +0200,
Giovanni Biscuolo <address@hidden> a écrit :
> Hello Guix,
>
> I'm trying to reconfigure but I get this error:
>
> 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?
>
> Anyway, this is my slightly obfuscated config.scm:
>
> --8<---------------cut here---------------start------------->8---
> ; This is batondor
>
> (use-modules (gnu))
> (use-service-modules networking ssh mcron virtualization)
> (use-package-modules linux)
>
> (define %authorized-guix-keys
> ;; List of authorized 'guix archive' keys.
> (list (local-file "keys/guix/OMISSIS.pub")
> (local-file "keys/guix/OMISSIS.pub")))
>
> (define gc-job
> ;; Run 'guix gc' at 3AM every day.
> #~(job '(next-hour '(3)) "guix gc -F 50G"))
>
> (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=50 -musage=70 /")))
>
> ;; The actual machine
>
> (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))
>
> (services
> (append
> (list (service openssh-service-type
> (openssh-configuration
> (port-number 22)
> (authorized-keys
> `(("x" ,(local-file "keys/ssh/x.pub"))))))
>
> (service dhcp-client-service-type)
>
> (service ntp-service-type)
>
> (service qemu-binfmt-service-type
> (qemu-binfmt-configuration
> (platforms (lookup-qemu-platforms "arm" "aarch64"))
> (guix-support? #t)))
>
> (service mcron-service-type
> (mcron-configuration
> (jobs (list gc-job btrfs-job))))
>
> (modify-services %base-services
> (guix-service-type config =>
> (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 =>
(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)))))))
>
> Am I missing something or did I found a bug?
>
> Thanks! Gio'.
>