From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id uNn5MiP0fmeGegEAqHPOHw:P1 (envelope-from ) for ; Wed, 08 Jan 2025 21:54:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id uNn5MiP0fmeGegEAqHPOHw (envelope-from ) for ; Wed, 08 Jan 2025 22:54:43 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=l0xQLjEG; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aUcJlwzZ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736373283; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nHcacDsx3UbBcvWhS9fL7gIR3YciMQVhqeT0y4xzKVg=; b=pTi3YBJTG9CTLGc1aWOKZiuFrTSYhHaFyNHF0YGLWyVlHjlvFkeuZvQ97n/c1HE8308evs E/to64vsHoeZb6YwEjQ+gHaxvssOt0VmC1Aq7lR6AL6Igu4F0lTNKaB8ZoQiWj+jebsEZ4 T90B7eP8WcO4VJh6DvrE9XAhTeJgOOT/fmccCGNa2foAdOE6oiEyyH6UJssCVqmNvexNNU groUn+GNJ/H1oS9sAMHIbUOLdCRAMCb0s08OlWgQwzO+AJ/bTKSO4+1IfryfScLI80qiH0 b5eD9K9eXuBc88ibzXyg8E1CznOZ8dCgcRO+FVCEtF7nSTtE7uYkRySa2KUpXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=l0xQLjEG; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aUcJlwzZ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736373283; a=rsa-sha256; cv=none; b=acFOOZ5ELTaGEmi5R8qtKxMLWMFhHlusHszVO3LY6RN7cLoyf2WUEuRukCFu7gHEgWyTTO q5/T6ViLeXZ7K/crnX0Bh2pPCn8pHyluhoJecrL4FoWVr6DUW05AmsGlK8VrXgB6B4wqlo 6Bk8tO4JpWAfN/8mXm4reg8yTErGAe1ecu9uzqNcOxLTtrJCwN4n7PjTz1IFdjZ9awvZ// 82spDoOCSAEf2lJFYl3f1uQPLDk9Xwq2ZhMBeIq/6ePYwWkMhPraMaupX10nBP6opqT0f2 rVFM3FLolAB48b1chJtr5z1Pb+Uu9mAdLyv6p4MmN5ueJ+od3VfXZtNUWnixkA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4C76B2C9E for ; Wed, 08 Jan 2025 22:54:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVe0Y-0001DK-20; Wed, 08 Jan 2025 16:54:34 -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 1tVe0C-0000LT-U2 for guix-patches@gnu.org; Wed, 08 Jan 2025 16:54:14 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVe0B-0004Ip-7K; Wed, 08 Jan 2025 16:54:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=nHcacDsx3UbBcvWhS9fL7gIR3YciMQVhqeT0y4xzKVg=; b=l0xQLjEGLI674Q1r49eocl55nR2lYlwcqqt88jMHNVBlqia9iykD8jEFOmQb3yBcth8FLRXSFmyu9aMKdPy/4XJ+9okXDziPjv16n5nLaEX0RS8TRWA46llNEV0YJcwPUcLj32KolthCYloLjNtiUkUNYrFPluJRpiULj1wiCuGXaikTICQY3XLTZYTlF2weNg9wg8CVOHqYUviZGG9RH3F7yuYFKlru/wITmgQsAB7GBcSAUHNxvT03UHxAe2510kzhPIR1GpyT8r2v8e1KLRFGX8MDc/5qlWJ+adjHwL8v/cW+UGE2MVyBQL9N4bfVRWFWmO21JMgY5f6tIEkwvg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVe05-0005YH-Ch; Wed, 08 Jan 2025 16:54:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH v3 10/12] home: Define =?UTF-8?Q?=E2=80=98%base-home-services=E2=80=99.?= Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, guix@cbaines.net, janneke@gnu.org, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, maxim.cournoyer@gmail.com, zimon.toutoune@gmail.com, tanguy@bioneland.org, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2025 21:54:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Andrew Tropin , Christopher Baines , Janneke Nieuwenhuizen , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tanguy Le Carrour , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Andrew Tropin , Christopher Baines , Janneke Nieuwenhuizen , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tanguy Le Carrour , Tobias Geerinckx-Rice Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.173637319821212 (code B ref 74860); Wed, 08 Jan 2025 21:54:05 +0000 Received: (at 74860) by debbugs.gnu.org; 8 Jan 2025 21:53:18 +0000 Received: from localhost ([127.0.0.1]:49320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVdzJ-0005Vw-PR for submit@debbugs.gnu.org; Wed, 08 Jan 2025 16:53:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55128) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVdz9-0005Tw-V4 for 74860@debbugs.gnu.org; Wed, 08 Jan 2025 16:53:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVdz4-00047W-LU; Wed, 08 Jan 2025 16:53:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=nHcacDsx3UbBcvWhS9fL7gIR3YciMQVhqeT0y4xzKVg=; b=aUcJlwzZoUfiZhJtjPzk 6kM1aG4N91ZP80RHInkjEEJFuQ6b3yTtC7OJh1k8sDXpBUHE45vRDOwhMUFfO1Cv2N26RbZoRfNL1 7Xhc6HKjD7tG4xHGzQlrppxDyl0TAfcjhauKPY91+2KO5d7PhBGb6zHcm+Md0lYsxyAEwAahNN7G8 QKNwKF9L8jOfdfJvucLrz129osX5J61vYpelmKIYNAbDZvm5798FKC+ICdobPyVSkxOvIwqxLbuy7 mYFC8NY4rmLjmo01VopUhOesr6OX0YkY2cuQ9xWXS6x+m7pFB2Qp/miRzttxozGw27FKrpacoKm0f QET/NA+s3NRtaw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 8 Jan 2025 22:51:58 +0100 Message-ID: X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 4C76B2C9E X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -1.97 X-Spam-Score: -1.97 X-TUID: f83OACy2e5UQ * gnu/home.scm (%base-home-services): New variable. ()[services]: Change default to ‘%base-home-services’. * guix/scripts/home/import.scm (manifest+configuration-files->code): Use ‘%base-home-services’ by default. * tests/home-import.scm (match-home-environment-no-services) (match-home-environment-transformations) (match-home-environment-no-services-nor-packages) (match-home-environment-bash-service) (match-home-environment-bash-service-with-alias): Adjust accordingly. * doc/he-config-bare-bones.scm: Use ‘%base-home-services’. * doc/guix.texi (Declaring the Home Environment): Add index entry for ‘%base-home-services’. Change-Id: Id95ede62b97a976aad138bfc4b63fc0bdf37c7de --- doc/guix.texi | 1 + doc/he-config-bare-bones.scm | 27 ++++++++++++------------ gnu/home.scm | 11 ++++++++-- guix/scripts/home/import.scm | 8 +++++--- tests/home-import.scm | 40 +++++++++++++++++++----------------- 5 files changed, 50 insertions(+), 37 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1b8047585d..f8ac7b1912 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46066,6 +46066,7 @@ Declaring the Home Environment @end quotation @findex home-environment +@vindex %base-home-services @lisp @include he-config-bare-bones.scm @end lisp diff --git a/doc/he-config-bare-bones.scm b/doc/he-config-bare-bones.scm index f948d85277..844d666110 100644 --- a/doc/he-config-bare-bones.scm +++ b/doc/he-config-bare-bones.scm @@ -7,19 +7,20 @@ (home-environment - (packages (list htop)) - (services - (list - (service home-bash-service-type - (home-bash-configuration - (guix-defaults? #t) - (bash-profile (list (plain-file "bash-profile" "\ + (packages (list htop)) + (services + (append (list + (service home-bash-service-type + (home-bash-configuration + (guix-defaults? #t) + (bash-profile (list (plain-file "bash-profile" "\ export HISTFILE=$XDG_CACHE_HOME/.bash_history"))))) - (simple-service 'test-config - home-xdg-configuration-files-service-type - (list `("test.conf" - ,(plain-file "tmp-file.txt" - "the content of - ~/.config/test.conf"))))))) + (simple-service 'test-config + home-xdg-configuration-files-service-type + (list `("test.conf" + ,(plain-file "tmp-file.txt" + "the content of + ~/.config/test.conf"))))) + %base-home-services))) diff --git a/gnu/home.scm b/gnu/home.scm index b390c8d534..042d2e67de 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -23,6 +23,7 @@ (define-module (gnu home) #:use-module (gnu home services shells) #:use-module (gnu home services xdg) #:use-module (gnu home services fontutils) + #:use-module (gnu home services admin) #:use-module (gnu services) #:use-module (guix records) #:use-module (guix diagnostics) @@ -43,7 +44,9 @@ (define-module (gnu home) home-environment-with-provenance - home-generation-base)) + home-generation-base + + %base-home-services)) ;;; Comment: ;;; @@ -67,7 +70,7 @@ (define-record-type* home-environment this-home-environment))) (services home-environment-user-services - (default '()) + (default %base-home-services) (sanitize validate-service-list)) (location home-environment-location ; @@ -75,6 +78,10 @@ (define-record-type* home-environment source-properties->location)) (innate))) +(define %base-home-services + ;; Non-essential but useful services to have by default. + '()) + (define (home-environment-default-essential-services he) "Return the list of essential services for home environment." (list diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index fd263c0699..15b4bc9798 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Andrew Tropin -;;; Copyright © 2021-2022 Ludovic Courtès +;;; Copyright © 2021-2022, 2024 Ludovic Courtès ;;; Copyright © 2022 Arjan Adriaanse ;;; Copyright © 2022 Antero Mejr ;;; @@ -160,7 +160,8 @@ (define (manifest+configuration-files->code manifest (home-environment (packages ,packages) - (services (list ,@services))))))) + (services (append (list ,@services) + %base-home-services))))))) (('begin ('specifications->manifest packages)) (match (configurations+modules configuration-directory) (((services . modules) ...) @@ -183,7 +184,8 @@ (define (manifest+configuration-files->code manifest ,(comment (G_ "\ ;; Below is the list of Home services. To search for available ;; services, run 'guix home search KEYWORD' in a terminal.\n")) - (services (list ,@services))))))))) + (services (append (list ,@services) + %base-home-services))))))))) (define* (import-manifest manifest destination-directory diff --git a/tests/home-import.scm b/tests/home-import.scm index 04b7b76156..57a3d62a72 100644 --- a/tests/home-import.scm +++ b/tests/home-import.scm @@ -115,7 +115,7 @@ (define-home-environment-matcher match-home-environment-no-services ('specifications->packages ('list "guile@2.0.9" "gcc:lib" "glibc@2.19"))) ('services - ('list))))) + ('append ('list) '%base-home-services))))) (define-home-environment-matcher match-home-environment-transformations ('begin @@ -131,7 +131,7 @@ (define-home-environment-matcher match-home-environment-transformations ('list (transform ('specification->package "guile@2.0.9")) ('list ('specification->package "gcc") "lib") ('specification->package "glibc@2.19"))) - ('services ('list))))) + ('services ('append ('list) '%base-home-services))))) (define-home-environment-matcher match-home-environment-no-services-nor-packages ('begin @@ -143,7 +143,7 @@ (define-home-environment-matcher match-home-environment-no-services-nor-packages ('packages ('specifications->packages ('list))) ('services - ('list))))) + ('append ('list) '%base-home-services))))) (define-home-environment-matcher match-home-environment-bash-service ('begin @@ -157,13 +157,14 @@ (define-home-environment-matcher match-home-environment-bash-service ('packages ('specifications->packages ('list))) ('services - ('list ('service - 'home-bash-service-type - ('home-bash-configuration - ('aliases ('quote ())) - ('bashrc - ('list ('local-file "/tmp/guix-config/.bashrc" - "bashrc")))))))))) + (append ('list ('service + 'home-bash-service-type + ('home-bash-configuration + ('aliases ('quote ())) + ('bashrc + ('list ('local-file "/tmp/guix-config/.bashrc" + "bashrc")))))) + '%base-home-services))))) (define-home-environment-matcher match-home-environment-bash-service-with-alias ('begin @@ -177,15 +178,16 @@ (define-home-environment-matcher match-home-environment-bash-service-with-alias ('packages ('specifications->packages ('list))) ('services - ('list ('service - 'home-bash-service-type - ('home-bash-configuration - ('aliases - ('quote (("grep" . "grep --exclude-from=\"$HOME/.grep-exclude\"") - ("ls" . "ls -p")))) - ('bashrc - ('list ('local-file "/tmp/guix-config/.bashrc" - "bashrc")))))))))) + ('append ('list ('service + 'home-bash-service-type + ('home-bash-configuration + ('aliases + ('quote (("grep" . "grep --exclude-from=\"$HOME/.grep-exclude\"") + ("ls" . "ls -p")))) + ('bashrc + ('list ('local-file "/tmp/guix-config/.bashrc" + "bashrc")))))) + '%base-home-services))))) (test-assert "manifest->code: No services" -- 2.47.1