unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: edk@beaver-labs.com
To: help-guix@gnu.org
Subject: Unknown getter "operating-system-user-services"
Date: Sat, 01 Jan 2022 18:11:36 +0100	[thread overview]
Message-ID: <874k6n74gd.fsf@rdklein.fr> (raw)

Dear all,

In order to programmatically define operating-systems, I use a
functional approach, where I edit the fields of the operating-system
structure using set-fields, like so:

https://gitlab.com/edouardklein/guix/-/blob/beaverlabs/beaver/system.scm#L106

#+begin_src scheme
(define* (add-something-to os)
  "Return a copy of OS (an operating-system) edited in such a way that some functionality is added to it."
  (set-fields os
              ((operating-system-user-services)
               (cons (simple-service "toto" some-service-type (list (some-service-conf)))
                     (operating-system-user-services os)))))
#+end_src

This allows for very nice OS declarations, for example my VPS is
declared like this, and it is immediately clear which services it provides:
#+begin_src scheme
(-> minimal-ovh
    (packages (list git))
    (denatting-webapp #:port 8000)
    (https-reverse-proxy
     #:from-host "denatting.beaver-labs.com"
     #:fullchain-path "/srv/ssl/certs/*.beaver-labs.com/fullchain.cer"
     #:privkey-path "/srv/ssl/certs/*.beaver-labs.com/private.key"
     #:to-port 8000
     #:raw-content '("client_max_body_size 1024M;"))
    (requisomatic-webapp #:port 8001)
    (https-reverse-proxy
     #:from-host "requisomatic.beaver-labs.com"
     #:fullchain-path "/srv/ssl/certs/*.beaver-labs.com/fullchain.cer"
     #:privkey-path "/srv/ssl/certs/*.beaver-labs.com/private.key"
     #:to-port 8001)
    (https-static-content
     #:from-host "dump.rdklein.fr"
     #:fullchain-path "/srv/ssl/certs/*.rdklein.fr/fullchain.cer"
     #:privkey-path "/srv/ssl/certs/*.rdklein.fr/private.key"
     #:to-dir "/srv/dump.rdklein.fr"
     #:allow-dir-listing #t)
    (https-static-content
     #:from-host "rdklein.fr"
     #:fullchain-path "/srv/ssl/certs/rdklein.fr/fullchain.cer"
     #:privkey-path "/srv/ssl/certs/rdklein.fr/private.key"
     #:to-dir "/srv/rdklein.fr"
     #:allow-dir-listing #f))
#+end_src

When I tried a guix pull today (after 18 days of not pulling), I got the
following error (with the above git repo being in my channels):

#+begin_src
(repl-version 0 1 1)
(exception syntax-error (value operating-system-user-services) (value "Wrong number of arguments") (value ((filename . "/gnu/store/xdvrkpldalcqjl9f10x9mlynkc8hb1bv-guix-45357d6/beaver/packages/python-xyz.scm") (line . 306) (column . 2))) (value (operating-system-user-services (%%on-error (unknown-getter (set-fields os ((operating-system-user-services) (cons (service requisomatic-service-type (requisomatic-configuration (user user) (group group) (db-file db-file) (log-file log-file) (pid-file pid-file) (bind-to (format #f "~a:~a" ip port)))) (operating-system-user-services os)))) operating-system-user-services)) %%type (((c-list)) ((c-same-type-check (quote (set-fields os ((operating-system-user-services) (cons (service requisomatic-service-type (requisomatic-configuration (user user) (group group) (db-file db-file) (log-file log-file) (pid-file pid-file) (bind-to (format #f "~a:~a" ip port)))) (operating-system-user-services os))))) (quote ()) (quote (operating-system-user-services))) (quote (let ((s os)) ((ck () ((@@ (srfi srfi-9) getter-copier) (quote operating-system-user-services) (quote (unknown-getter (set-fields os ((operating-system-user-services) (cons (service requisomatic-service-type (requisomatic-configuration (user user) (group group) (db-file db-file) (log-file log-file) (pid-file pid-file) (bind-to (format #f "~a:~a" ip port)))) (operating-system-user-services os)))) operating-system-user-services)))) #t s (operating-system-user-services (%set-fields #t (set-fields os ((operating-system-user-services) (cons (service requisomatic-service-type (requisomatic-configuration (user user) (group group) (db-file db-file) (log-file log-file) (pid-file pid-file) (bind-to (format #f "~a:~a" ip port)))) (operating-system-user-services os)))) (operating-system-user-services) (struct-ref s (ck () ((@@ (srfi srfi-9) getter-index) (quote operating-system-user-services) (quote (unknown-getter (set-fields os ((operating-system-user-services) (cons (service requisomatic-service-type (requisomatic-configuration (user user) (group group) (db-file db-file) (log-file log-file) (pid-file pid-file) (bind-to (format #f "~a:~a" ip port)))) (operating-system-user-services os)))) operating-system-user-services))))) (() (cons (service requisomatic-service-type (requisomatic-configuration (user user) (group group) (db-file db-file) (log-file log-file) (pid-file pid-file) (bind-to (format #f "~a:~a" ip port)))) (operating-system-user-services os)))))))))))) (value #f))
#+end_src

If you want to try, here is my channels.scm file:
#+begin_src
(cons*
 (channel
  (name 'beaverlabs)
  (url "https://gitlab.com/edouardklein/guix")
  (branch "beaverlabs"))
 (channel
  (name 'guix-gaming-games)
  (url "https://gitlab.com/guix-gaming-channels/games.git")
  ;; Enable signature verification:
  (introduction
   (make-channel-introduction
    "c23d64f1b8cc086659f8781b27ab6c7314c5cca5"
    (openpgp-fingerprint
     "50F3 3E2E 5B0C 3D90 0424  ABE8 9BDC F497 A4BB CC7F"))))
 %default-channels)
#+end_src

I'll dive into it sometimes later this week or the week after, but if
somebody know right of the bat what might cause this problem, I'd be
happy to know.

Thanks in advance,

Cheers,

Edouard.


                 reply	other threads:[~2022-01-01 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=874k6n74gd.fsf@rdklein.fr \
    --to=edk@beaver-labs.com \
    --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).