Hi,

Alexander Asteroth <[email protected]> writes:

> Dear Tomas,
>
> Would you mind sharing your wrapper script? Maybe I (and others) can learn 
> from
> it.

Sure :) The slightly edited version is below:

--8<---------------cut here---------------start------------->8---
#!/bin/sh
# Copyright (C) 2025 Tomas Volf <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-only
set -eu
set -x

buildflags=--verbosity=1

d=/tmp/channel-update-test
if [ -d "$d" ]; then
        printf 'Directory already exists: %s\n' "$d"
        exit 1
fi

mkdir "$d"
prof=$d/profile
chan=$d/channels.sex
guix=$prof/bin/guix

guix pull $buildflags --profile "$prof" -C files/channels-base.sex
"$guix" describe --format=channels >"$chan"

for s in laptop server1 server2; do
        "$guix" system build $buildflags -L . systems/"$s".scm
done

for h in me@laptop; do
        "$guix" home build $buildflags -L . homes/"$h".scm
done

"$guix" pull $buildflags -C "$chan"
cp "$chan" files/channels.sex

rm -rvf "$d"
--8<---------------cut here---------------end--------------->8---

It is relatively new script, so there might be bugs.  The base file for
the channels (`channels-base.sex') is the *not* pinned version, so for
me the following:

--8<---------------cut here---------------start------------->8---
(cons* (channel
        (name 'guix)
        (url "https://git.wolfsden.cz/.git/guix";)
        (introduction
         (make-channel-introduction
          "028e445a2028068e3c83996daa281057f19141a0"
          (openpgp-fingerprint
           "B783 49B3 8C14 7D36 2988  68A4 2FBF EE7D B67F C1A9"))))
       (channel
        (name 'wolfsden)
        (url "https://git.wolfsden.cz/.git/wolfsden";)
        (introduction
         (make-channel-introduction
          "49d7c72d2c3ae36ae8cf045dc7c00da29801af2c"
          (openpgp-fingerprint
           "B783 49B3 8C14 7D36 2988  68A4 2FBF EE7D B67F C1A9"))))
       (channel
        (name 'nonguix)
        (url "https://gitlab.com/nonguix/nonguix";)
        (introduction
         (make-channel-introduction
          "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
          (openpgp-fingerprint
           "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
       (filter (negate guix-channel?) %default-channels))
--8<---------------cut here---------------end--------------->8---

the pinned version (`channels.sex') is produced by `guix describe' and
subsequently copied to all the machines to /etc/guix/channels.scm during
the reconfigure.

Hope this helps,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Reply via email to