Hi Hugo,
Hugo Buddelmeijer via "Development of GNU Guix and the GNU System
distribution." <[email protected]> writes:
Indeed! I had several things like this in my config.scm:
(simple-service
'guix-authorized-keys guix-service-type
(guix-extension
(authorized-keys
(list (plain-file "ci.guix.gnu.org.pub.pub"
"(public-key
(ecc
(curve Ed25519)
(q
#8D156F295D24B0D9A86FA5741A840FF2D24F60F7B6C4134814AD55625971B394#)
)
)")))))
Horror! You have spoiled me, with 'scheme everywhere'.
I work around this by defining these in the (atomized system
archive-keys) module in my channel[1]. Then I can refer to the
variables when I need to use them[2], and let the ugly code live
in a module I don’t need to look at very often.
Noting that this problem exists because the system current
requires a sexp to be represented in code as a string, which isn’t
very Lispy. Lisp is excellent at reading and writing
s-expressions, so this is a bit puzziling to me; I’d expect a
design more like: a record to hold the key, along with procedures
to print it (to write the file) and read that back (to construct a
public-key record). Some REPL experimentation seems to indicate
that the q value presents some problems with this approach --
Guile cannot read that value at all -- so presumably this is why
(or part of why) it’s like this.
I think it’d be very nice if the keys could be represented as Lisp
objects.
-- Ian
[1]:
https://codeberg.org/ieure/atomized-guix/src/branch/main/atomized/system/archive-keys.scm
[2]:
https://codeberg.org/ieure/atomized-guix/src/commit/9add63cec28117dd45499b4ee81277cc664a16ea/atomized/system/profiles.scm#L123