Subject: tor-onion-service-configuration example in Guix Manual does not work

From: raid5atemyhomework <[email-masked]>
Date: Thu, 09 Jan 2025 03:04:29 +0000

Guix has been pestering me about the deprecation of `tor-hidden-service` for a year now.  So I checked out the manual to see the correct official way that replaces `tor-hidden-service`:

```text
 -- Variable: tor-service-type
     Type for a service that runs the Tor (https://torproject.org)
     anonymous networking daemon.  The service is configured using a
     ‘<tor-configuration>’ record.  By default, the Tor daemon runs as
     the ‘tor’ unprivileged user, which is a member of the ‘tor’ group.

     Services of this type can be extended by other services to specify
     “onion services” (in addition to those already specified in
     ‘tor-configuration’) as in this example:

          (simple-service 'my-extra-onion-service tor-service-type
                          (list (tor-onion-service-configuration
                                  (name "extra-onion-service")
                                  (mapping '((80 . "127.0.0.1:8080"))))))
```

I created a simple `configuration.scm` that uses the above example verbatim in the `services` list, and got this error on `guix system build`:

```text
building /gnu/store/c3x922pfx3lcb8nzwcns6k43ncaj2asj-torrc.drv...
Backtrace: 
           4 (primitive-load "/gnu/store/1flyd8skq8cx6p8d7cpv5b99rxc?")
In ice-9/ports.scm:
   433:17  3 (call-with-output-file _ _ #:binary _ #:encoding _)
In ice-9/eval.scm:
    619:8  2 (_ #(#(#<directory (guile-user) 7ffff7812c80>) #<outp?>))
In ice-9/boot-9.scm:
   260:13  1 (for-each #<procedure 7ffff2d3fe00 at ice-9/eval.scm:3?> ?)
In ice-9/eval.scm:
    619:8  0 (_ #(#(#<directory (guile-user) 7ffff7812c80> ("e?" ?))))

ice-9/eval.scm:619:8: Throw to key `match-error' with args `("match" "no matching pattern" ("extra-onion-service" (80 . "127.0.0.1:8080")))'.
builder for `/gnu/store/c3x922pfx3lcb8nzwcns6k43ncaj2asj-torrc.drv' failed with exit code 1
build of /gnu/store/c3x922pfx3lcb8nzwcns6k43ncaj2asj-torrc.drv failed
```

Please do not deprecate `tor-hidden-service` until your replacement has actually been tested to ***actually work*** on some very simple use-case example.

I attached the simple example that fails.