Subject: Re: [PATCH v2 3/3] services: Add block-facebook-hosts-service-type.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 23 Jan 2023 23:40:52 +0100

Bruno Victal <[email-masked]> skribis:

> Deprecates %facebook-host-aliases in favour of using
> hosts-service-type service extensions.
>
> * gnu/services/networking.scm
> (block-facebook-hosts-service-type): New variable.
> (%facebook-host-aliases): Deprecate variable.
> * doc/guix.texi: Document it.

[...]

> -fe80::1%lo0 www.connect.facebook.net
> -fe80::1%lo0 apps.facebook.com\n")
> -
> +  (let ((domains '("facebook.com" "www.facebook.com"
> +                   "login.facebook.com" "www.login.facebook.com"
> +                   "fbcdn.net" "www.fbcdn.net" "fbcdn.com" "www.fbcdn.com"
> +                   "static.ak.fbcdn.net" "static.ak.connect.facebook.com"
> +                   "connect.facebook.net" "www.connect.facebook.net"
> +                   "apps.facebook.com")))
> +    (append-map (lambda (name)
> +                  (map (lambda (addr)
> +                         (host addr name))
> +                       (list "127.0.0.1" "::1"))) domains)))

The IPv6 address is different, but now I’m not sure whether fe80::1%lo0
made sense?

> +(define-deprecated %facebook-host-aliases
> +  block-facebook-hosts-service-type
> +  (let ((<host-entry> (@ (gnu services) <host-entry>)))
> +    (string-join
> +     (map (match-lambda
> +            (($ <host-entry> address canonical-name)

Avoid matching on records, just use the accessors.

Otherwise LGTM, thanks!

Ludo’.