From: Julien Lepiller <julien@lepiller.eu>
To: Giovanni Biscuolo <g@xelera.eu>
Cc: help-guix@gnu.org
Subject: Re: guix system reconfigure: Wrong type argument in position 1 (expecting struct)
Date: Tue, 18 Jun 2019 18:19:51 +0200 [thread overview]
Message-ID: <20190618181946.4cc559bf@tachikoma.lepiller.eu> (raw)
In-Reply-To: <877e9j9c74.fsf@roquette.mug.biscuolo.net>
Le Tue, 18 Jun 2019 16:53:51 +0200,
Giovanni Biscuolo <g@xelera.eu> 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'.
>
next prev parent reply other threads:[~2019-06-18 16:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 14:53 guix system reconfigure: Wrong type argument in position 1 (expecting struct) Giovanni Biscuolo
2019-06-18 16:19 ` Julien Lepiller [this message]
2019-06-19 6:02 ` Giovanni Biscuolo
2019-06-18 16:36 ` Ricardo Wurmus
2019-06-19 6:22 ` Giovanni Biscuolo
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190618181946.4cc559bf@tachikoma.lepiller.eu \
--to=julien@lepiller.eu \
--cc=g@xelera.eu \
--cc=help-guix@gnu.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).