From patchwork Wed Jan 11 17:28:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 46037 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4EDCE27BBEB; Wed, 11 Jan 2023 17:29:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F36C227BBE9 for ; Wed, 11 Jan 2023 17:29:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFeuN-0007Hv-RM; Wed, 11 Jan 2023 12:29:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFeuM-0007Hb-FC for guix-patches@gnu.org; Wed, 11 Jan 2023 12:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFeuM-0001RS-6m for guix-patches@gnu.org; Wed, 11 Jan 2023 12:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFeuM-0003eX-2I for guix-patches@gnu.org; Wed, 11 Jan 2023 12:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60735] [PATCH 1/2] services: Add etc-hosts-service-type. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 11 Jan 2023 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60735 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60735@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 60735-submit@debbugs.gnu.org id=B60735.167345812113998 (code B ref 60735); Wed, 11 Jan 2023 17:29:02 +0000 Received: (at 60735) by debbugs.gnu.org; 11 Jan 2023 17:28:41 +0000 Received: from localhost ([127.0.0.1]:43729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFeu0-0003dh-Ax for submit@debbugs.gnu.org; Wed, 11 Jan 2023 12:28:41 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:58528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFetx-0003dY-VI for 60735@debbugs.gnu.org; Wed, 11 Jan 2023 12:28:39 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 478A121102 for <60735@debbugs.gnu.org>; Wed, 11 Jan 2023 18:28:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 06B4780096; Wed, 11 Jan 2023 18:28:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qtDgHqOWWAs3; Wed, 11 Jan 2023 18:28:36 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-118-236.dsl.telepac.pt [85.242.118.236]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 33E4E80093; Wed, 11 Jan 2023 18:28:36 +0100 (CET) From: Bruno Victal Date: Wed, 11 Jan 2023 17:28:13 +0000 Message-Id: <0248101fa24f80f52a0412930598a7bbc9f71194.1673457786.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services.scm (etc-hosts-service-type): New variable. * gnu/system.scm (operating-system-hosts-file): Deprecate procedure. (warn-hosts-file-field-deprecation): New procedure, helper for deprecated variable). (operating-system)[hosts-file]: Use helper to warn deprecated field. (operating-system-default-essential-services) (hurd-default-essential-services): Use etc-hosts-service-type. (local-host-aliases): Return a list of strings representing hosts file entries. (default-/etc/hosts): Remove procedure. (operating-system-etc-service): Remove hosts file. * doc/guix.texi: Document it. --- doc/guix.texi | 13 ++++++++++++ gnu/services.scm | 18 ++++++++++++++++ gnu/system.scm | 55 ++++++++++++++++++++++++++++++++++++------------ 3 files changed, 72 insertions(+), 14 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 39c6468651..a55634ba8c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -111,6 +111,7 @@ Copyright @copyright{} 2022 John Kehayias@* Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* Copyright @copyright{} 2023 Giacomo Leidi@* +Copyright @copyright{} 2023 Bruno Victal@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -40121,6 +40122,18 @@ Service Reference pointing to the given file. @end defvr +@defvar etc-hosts-service-type +Type of the service that populates the entries for (@file{/etc/hosts}). +This service can be extended by passing it lists of strings such as: + +@c TRANSLATORS: The domain names below SHOULD NOT be translated. +@c They're domains reserved for use in documentation. (RFC6761 Section 6.5) +@lisp +(list "127.0.0.1 example.com example.net" + "::1 example.com example.net" +@end lisp +@end defvar + @defvr {Scheme Variable} setuid-program-service-type Type for the ``setuid-program service''. This service collects lists of executable file names, passed as gexps, and adds them to the set of diff --git a/gnu/services.scm b/gnu/services.scm index 2abef557d4..2d8e2c8ad2 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2020 Christine Lemmer-Webber ;;; Copyright © 2020, 2021 Brice Waegeneire +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -109,6 +110,7 @@ (define-module (gnu services) extra-special-file etc-service-type etc-directory + etc-hosts-service-type setuid-program-service-type profile-service-type firmware-service-type @@ -809,6 +811,22 @@ (define (etc-service files) FILES must be a list of name/file-like object pairs." (service etc-service-type files)) +(define etc-hosts-service-type + ;; Extend etc-service-type with a entry for @file{/etc/hosts}. + (service-type + (name 'etc-hosts) + (extensions + (list + (service-extension etc-service-type + (lambda (lst) + `(("hosts" + ,(plain-file "hosts" + (string-join lst "\n" + 'suffix)))))))) + (compose concatenate) + (extend append) + (description "Populate the @file{/etc/hosts} file."))) + (define (setuid-program->activation-gexp programs) "Return an activation gexp for setuid-program from PROGRAMS." (let ((programs (map (lambda (program) diff --git a/gnu/system.scm b/gnu/system.scm index d67f9a615b..a1514b5109 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2020, 2022 Efraim Flashner ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2021 raid5atemyhomework +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,6 +32,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu system) + #:use-module (guix discovery) #:use-module (guix inferior) #:use-module (guix store) #:use-module (guix memoization) @@ -97,7 +99,7 @@ (define-module (gnu system) operating-system-user-services operating-system-packages operating-system-host-name - operating-system-hosts-file + operating-system-hosts-file ;deprecated operating-system-hurd operating-system-kernel operating-system-kernel-file @@ -208,6 +210,15 @@ (define* (bootable-kernel-arguments system root-device version) #$system "/boot"))) ;; System-wide configuration. + +(define-with-syntax-properties (warn-hosts-file-field-deprecation + (value properties)) + (when value + (warning (source-properties->location properties) + (G_ "the 'hosts-file' field is deprecated, please use \ +'etc-hosts-service-type' instead~%"))) + value) + ;; TODO: Add per-field docstrings/stexi. (define-record-type* operating-system make-operating-system @@ -239,8 +250,9 @@ (define-record-type* operating-system (default %base-firmware)) (host-name operating-system-host-name) ; string - (hosts-file operating-system-hosts-file ; file-like | #f - (default #f)) + (hosts-file %operating-system-hosts-file ; deprecated + (default #f) + (sanitize warn-hosts-file-field-deprecation)) (mapped-devices operating-system-mapped-devices ; list of (default '())) @@ -296,6 +308,10 @@ (define-record-type* operating-system source-properties->location)) (innate))) +(define-deprecated (operating-system-hosts-file os) + etc-hosts-service-type + (%operating-system-hosts-file os)) + (define* (operating-system-kernel-arguments os root-device #:key (version %boot-parameters-version)) "Return all the kernel arguments, including the ones not specified directly @@ -733,7 +749,8 @@ (define (operating-system-default-essential-services os) (non-boot-fs (non-boot-file-system-service os)) (swaps (swap-services os)) (procs (service user-processes-service-type)) - (host-name (host-name-service (operating-system-host-name os))) + (host-name (operating-system-host-name os)) + (hosts-file (operating-system-hosts-file os)) (entries (operating-system-directory-base-entries os))) (cons* (service system-service-type entries) (service linux-builder-service-type @@ -755,12 +772,19 @@ (define (operating-system-default-essential-services os) (operating-system-groups os)) (operating-system-skeletons os)) (operating-system-etc-service os) + ;; XXX: hosts-file is deprecated + (if hosts-file + (simple-service 'deprecated-hosts-file etc-service-type + (list `("hosts" ,hosts-file))) + (service etc-hosts-service-type + (local-host-aliases host-name))) (service fstab-service-type (filter file-system-needed-for-boot? (operating-system-file-systems os))) (session-environment-service (operating-system-environment-variables os)) - host-name procs root-fs + (host-name-service host-name) + procs root-fs (service setuid-program-service-type (operating-system-setuid-programs os)) (service profile-service-type @@ -774,7 +798,9 @@ (define (operating-system-default-essential-services os) (operating-system-firmware os))))))) (define (hurd-default-essential-services os) - (let ((entries (operating-system-directory-base-entries os))) + (let ((host-name (operating-system-host-name os)) + (hosts-file (operating-system-hosts-file os)) + (entries (operating-system-directory-base-entries os))) (list (service system-service-type entries) %boot-service %hurd-startup-service @@ -794,6 +820,12 @@ (define (hurd-default-essential-services os) (operating-system-file-systems os))) (pam-root-service (operating-system-pam-services os)) (operating-system-etc-service os) + ;; XXX: hosts-file is deprecated + (if hosts-file + (simple-service 'deprecated-hosts-file etc-service-type + (list `("hosts" ,hosts-file))) + (service etc-hosts-service-type + (local-host-aliases host-name))) (service setuid-program-service-type (operating-system-setuid-programs os)) (service profile-service-type (operating-system-packages os))))) @@ -914,12 +946,9 @@ (define %default-issue (define (local-host-aliases host-name) "Return aliases for HOST-NAME, to be used in /etc/hosts." - (string-append "127.0.0.1 localhost " host-name "\n" - "::1 localhost " host-name "\n")) - -(define (default-/etc/hosts host-name) - "Return the default /etc/hosts file." - (plain-file "hosts" (local-host-aliases host-name))) + (list + (string-join `("127.0.0.1" "localhost" ,host-name) "\t") + (string-join `("::1" "localhost" ,host-name) "\t"))) (define (validated-sudoers-file file) "Return a copy of FILE, a sudoers file, after checking that it is @@ -1068,8 +1097,6 @@ (define* (operating-system-etc-service os) ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '()) ("profile" ,#~#$profile) ("bashrc" ,#~#$bashrc) - ("hosts" ,#~#$(or (operating-system-hosts-file os) - (default-/etc/hosts (operating-system-host-name os)))) ;; Write the operating-system-host-name to /etc/hostname to prevent ;; NetworkManager from changing the system's hostname when connecting ;; to certain networks. Some discussion at From patchwork Wed Jan 11 17:28:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 46038 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6107627BBEB; Wed, 11 Jan 2023 17:29:38 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8FA3927BBE9 for ; Wed, 11 Jan 2023 17:29:37 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFeuO-0007Hz-AO; Wed, 11 Jan 2023 12:29:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFeuM-0007Hi-Py for guix-patches@gnu.org; Wed, 11 Jan 2023 12:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFeuM-0001RX-Hz for guix-patches@gnu.org; Wed, 11 Jan 2023 12:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFeuM-0003ef-Dc for guix-patches@gnu.org; Wed, 11 Jan 2023 12:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60735] [PATCH 2/2] services: Add block-facebook-hosts-service-type. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 11 Jan 2023 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60735 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60735@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 60735-submit@debbugs.gnu.org id=B60735.167345813014023 (code B ref 60735); Wed, 11 Jan 2023 17:29:02 +0000 Received: (at 60735) by debbugs.gnu.org; 11 Jan 2023 17:28:50 +0000 Received: from localhost ([127.0.0.1]:43732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFeuA-0003e6-5X for submit@debbugs.gnu.org; Wed, 11 Jan 2023 12:28:50 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:58560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFeu7-0003dx-Vl for 60735@debbugs.gnu.org; Wed, 11 Jan 2023 12:28:48 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 88AB721102 for <60735@debbugs.gnu.org>; Wed, 11 Jan 2023 18:28:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 4731C80096; Wed, 11 Jan 2023 18:28:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ePxDfwfySSWo; Wed, 11 Jan 2023 18:28:45 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-118-236.dsl.telepac.pt [85.242.118.236]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id ECE9280093; Wed, 11 Jan 2023 18:28:44 +0100 (CET) From: Bruno Victal Date: Wed, 11 Jan 2023 17:28:14 +0000 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Deprecates %facebook-host-aliases in favour of using etc-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. --- doc/guix.texi | 29 ++++-------------- gnu/services/networking.scm | 61 ++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 55 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a55634ba8c..703e0e6769 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20952,34 +20952,17 @@ Networking Services @end table @end deftp -@defvr {Scheme Variable} %facebook-host-aliases -This variable contains a string for use in @file{/etc/hosts} -(@pxref{Host Names,,, libc, The GNU C Library Reference Manual}). Each -line contains a entry that maps a known server name of the Facebook +@defvar block-facebook-hosts-service-type +This service type adds a list of known Facebook hosts to the +@file{/etc/hosts} file. +(@pxref{Host Names,,, libc, The GNU C Library Reference Manual}) +Each line contains a entry that maps a known server name of the Facebook on-line service---e.g., @code{www.facebook.com}---to the local host---@code{127.0.0.1} or its IPv6 equivalent, @code{::1}. -This variable is typically used in the @code{hosts-file} field of an -@code{operating-system} declaration (@pxref{operating-system Reference, -@file{/etc/hosts}}): - -@lisp -(use-modules (gnu) (guix)) - -(operating-system - (host-name "mymachine") - ;; ... - (hosts-file - ;; Create a /etc/hosts file with aliases for "localhost" - ;; and "mymachine", as well as for Facebook servers. - (plain-file "hosts" - (string-append (local-host-aliases host-name) - %facebook-host-aliases)))) -@end lisp - This mechanism can prevent programs running locally, such as Web browsers, from accessing Facebook. -@end defvr +@end defvar The @code{(gnu services avahi)} provides the following definition. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 702404bc6c..9e5caed3c5 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2022 Andrew Tropin +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -79,7 +80,9 @@ (define-module (gnu services networking) #:use-module (json) #:re-export (static-networking-service static-networking-service-type) - #:export (%facebook-host-aliases + #:export (%facebook-host-aliases ;deprecated + block-facebook-hosts-service-type + dhcp-client-service-type dhcp-client-configuration dhcp-client-configuration? @@ -234,39 +237,33 @@ (define-module (gnu services networking) ;;; ;;; Code: -(define %facebook-host-aliases +(define facebook-host-aliases ;; This is the list of known Facebook hosts to be added to /etc/hosts if you ;; are to block it. - "\ -# Block Facebook IPv4. -127.0.0.1 www.facebook.com -127.0.0.1 facebook.com -127.0.0.1 login.facebook.com -127.0.0.1 www.login.facebook.com -127.0.0.1 fbcdn.net -127.0.0.1 www.fbcdn.net -127.0.0.1 fbcdn.com -127.0.0.1 www.fbcdn.com -127.0.0.1 static.ak.fbcdn.net -127.0.0.1 static.ak.connect.facebook.com -127.0.0.1 connect.facebook.net -127.0.0.1 www.connect.facebook.net -127.0.0.1 apps.facebook.com - -# Block Facebook IPv6. -fe80::1%lo0 facebook.com -fe80::1%lo0 login.facebook.com -fe80::1%lo0 www.login.facebook.com -fe80::1%lo0 fbcdn.net -fe80::1%lo0 www.fbcdn.net -fe80::1%lo0 fbcdn.com -fe80::1%lo0 www.fbcdn.com -fe80::1%lo0 static.ak.fbcdn.net -fe80::1%lo0 static.ak.connect.facebook.com -fe80::1%lo0 connect.facebook.net -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"))) + (fold (lambda (x tail) + (cons* (string-join `("127.0.0.1" ,x) "\t") + (string-join `("::1" ,x) "\t") + tail)) + '() domains))) + +(define-deprecated %facebook-host-aliases + block-facebook-hosts-service-type + (string-join facebook-host-aliases "\n" 'suffix)) + +(define block-facebook-hosts-service-type + (service-type + (name 'block-facebook-hosts) + (extensions + (list (service-extension etc-hosts-service-type + (const facebook-host-aliases)))) + (default-value #f) + (description "Add a list of known Facebook hosts to @file{/etc/hosts}"))) (define-record-type* dhcp-client-configuration make-dhcp-client-configuration