unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Marek Paśnikowski" <marek@marekpasnikowski.pl>
To: help-guix@gnu.org
Subject: Modification of Services with External Definitions of Clause Bodies
Date: Thu, 23 May 2024 14:58:16 +0200	[thread overview]
Message-ID: <2186006.irdbgypaU6@akashi> (raw)

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

Good day to you all.

I am trying to achieve the following configuration pattern:

(define-public %distribution-services
  (modify-services %desktop-services
                   (1-service-type config => 1-change)
                   (2-service-type config => 2-change)
                   (3-service-type config => 3-change)
                   ...
                   (n-service-type config => n-change)))

Each k-change is to be defined in its own, external module almost like this:

(define-public k-change
  (lambda (config)
    (k-service-configuration (inherit config)
                             ...
                             (n-customization)))

I wrote almost, because the presented pattern still fails to execute.
Regardless, this is the furthest I was able to go — this approach fails during
system reconfiguration, as opposed to the other attempts which failed during
guix pull.

The error message:

In procedure struct-vtable:
Wrong type argument in posistion 1 (expecting struct):
#<procedure k-change (config)>

I know WHY it fails - lambdas do return procedures.  My question to you is,
how can I modify the k-change definition to have it return the appropriate
service configuration structure?

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2024-05-23 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 12:58 Marek Paśnikowski [this message]
2024-05-26 12:24 ` Modification of Services with External Definitions of Clause Bodies Marek Paśnikowski

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=2186006.irdbgypaU6@akashi \
    --to=marek@marekpasnikowski.pl \
    --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).