From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yCBaMI7tAGFmXwAAgWs5BA (envelope-from ) for ; Wed, 28 Jul 2021 07:39:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uNQPLI7tAGFxNwAA1q6Kng (envelope-from ) for ; Wed, 28 Jul 2021 05:39:26 +0000 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 2BEDE22CC7 for ; Wed, 28 Jul 2021 07:39:26 +0200 (CEST) Received: from localhost ([::1]:45922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8cHs-0004pY-78 for larch@yhetil.org; Wed, 28 Jul 2021 01:39:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8cHW-0004pC-Eu for guix-patches@gnu.org; Wed, 28 Jul 2021 01:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8cHW-0006Gv-7k for guix-patches@gnu.org; Wed, 28 Jul 2021 01:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m8cHW-00020g-3f for guix-patches@gnu.org; Wed, 28 Jul 2021 01:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49419] [PATCH 0/4] Essential home services References: <87y2akhiz1.fsf@trop.in> Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Jul 2021 05:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49419 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 49419@debbugs.gnu.org Received: via spool by 49419-submit@debbugs.gnu.org id=B49419.16274507067675 (code B ref 49419); Wed, 28 Jul 2021 05:39:02 +0000 Received: (at 49419) by debbugs.gnu.org; 28 Jul 2021 05:38:26 +0000 Received: from localhost ([127.0.0.1]:54447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8cGv-0001zi-MV for submit@debbugs.gnu.org; Wed, 28 Jul 2021 01:38:26 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:36781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8cGr-0001zT-Nn for 49419@debbugs.gnu.org; Wed, 28 Jul 2021 01:38:24 -0400 Received: by mail-lj1-f173.google.com with SMTP id r23so1663700lji.3 for <49419@debbugs.gnu.org>; Tue, 27 Jul 2021 22:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version; bh=rLNzPXGzxqFeWKkG6BQzm8lBTIA7JU1hfA9F6mKjIOg=; b=QM21ddI8j5Q2TAWs+NZ5XWPUtQUR+mNlUlHxgTDw/UBDGYEbYeNPLVeK+EY7D/j0FW jh27aEgDGPG3e02PmEPgafASxW3yHmKlIMWZHfgIZjluDlxDedle9nKLaz+kM61RVZjq +CVUlko1yg/XfeHWM2g7N6cUHnJKYqdRxRc4Q0W/6j0IzDfYnjRPMfLFIMiiS10oUTwh meUMBYnJvl9NWW9j2jgYasmX0t6eG9mjPBjeCWkG7+x4PKIMjn6AKEkwWBLlnpLGNqvl GDF7pZOtGkYwzxNRFygmHRGZYvQKYcscEIEKCQVM+DpfVerN9bWdEPUR2YpmAHXQUmq1 N3ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :mime-version; bh=rLNzPXGzxqFeWKkG6BQzm8lBTIA7JU1hfA9F6mKjIOg=; b=DDd/wgxyDTCNX+YCpse2Eowg3sNSieU3q8oV7uFzUj+Tk6mkN41SrjAj+6CLIleskl 6b/+62J8REZoJjNLlSsrvotgYeO1v4pRInaJccMW1RejMcoUbg4/qNmS5DTDwb+nNvGo 9dtreTj0dSMzd9vLsJOOYVY8r5MDDYnkzQnTxAhI3IGFT+EQr16XxiErBLvpMJ8yTY7G Qkw5SG/oK/h9uQahcqnau/PHMPROU+dcM+sBkMXBRbv6xzO3RKxkaj8fyXJ+uTQli9d3 VI8F5EeV1C6LyWvz8wYkJpML3Wopq7WcPYa1kCop4HofaQkf/OYtJUahiANwq3ApzPOf BGSA== X-Gm-Message-State: AOAM531h1UpuA+VUaO8Iz+3OFPtXjjXSZJ6NQN1XqZXv3gzMOczRg6Pj Qqo7pWybUb/e1y6rRLoUmv13wQ== X-Google-Smtp-Source: ABdhPJyrMrsozWWB+KpQtqQqVvms8k4OJIwu5TkbeBx/n+QluYRhGTscJXWgZ18KSGeejVwbc+JHuQ== X-Received: by 2002:a2e:9c58:: with SMTP id t24mr17328512ljj.411.1627450695520; Tue, 27 Jul 2021 22:38:15 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id s21sm428545lji.57.2021.07.27.22.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 22:38:14 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87im13g0vs.fsf_-_@gnu.org> Date: Wed, 28 Jul 2021 08:35:59 +0300 Message-ID: <87lf5rj8zk.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627450766; 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: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=rLNzPXGzxqFeWKkG6BQzm8lBTIA7JU1hfA9F6mKjIOg=; b=E8PKRTotxO+GCZUvPkgq0UW9Yq5bM3Uf1dlNLk9MprAtIE0qqp6mdUOwN7L++Nr2V0kS2+ 5mEIQGWE4ssAPqol6pb6I11Uhh5WMpqu3fbBUZneJraXM/a7DLIZYtRYwCIaHmQKCO5857 FXGamVI1Jj8vk9nl1JUkuEwGVM1zjxmupLSATQWC6hol7XXd+938PHEsHc3261Kw9ZIdoa zDHse254G2k84sbqLC78vmQhoCrS6rlcP5DtPXzLs/bc2zzNg7LTixcd+ZMAElP3kZYjgI cg/49iHvRC5fDTGknTUnFhagkB6bMJGgq9wJgX8uczIZvPcQfMlz1+Iav/NRWw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627450766; a=rsa-sha256; cv=none; b=bwXyFAPwp3Apyq9n3LU/O5Jt51DHVn66ZxTSReS8dCL99SYDUUzOXb/AKbCIFiBDDJg9Jy Dzoq/zxFG7OXFLjwdiqxYvXDhoyV5BMhB3NV8Q7lDUC8ur/9Ar//WSfxmAdf3e7MFiLogY 69KVcHnPfsHpsUiOiQSO9JHG393B3g+2Z9LyoshlhRaRJsAnEu3vJ97zZDoABL/DRF5hQr n8yHqPo2vkLSs/Md2M7T9BdrLpB3KEvwLQS1urM2w4nuAC/k+Ewc3z4caqdqPY37KwJ794 QCYpMRZFsxvDBpyYbt7NDc9HJY/t+KZhZyO7hGwioA/2Dt3RzO82Zj0CwjcN9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20150623.gappssmtp.com header.s=20150623 header.b=QM21ddI8; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.52 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20150623.gappssmtp.com header.s=20150623 header.b=QM21ddI8; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 2BEDE22CC7 X-Spam-Score: -3.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: Bnm5wGHW+JEg --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi Andrew, > > Andrew Tropin skribis: > >> Diff with v2: Prevents unecessary calls to system* >> >> Please, when review finished, apply against guix-home-wip branch. >> >> Andrew Tropin (4): >> home-services: Add most essential home services >> home-services: Add home-run-on-change-service-type >> home-services: Add home-provenance-service-type >> home-services: Add fold-home-service-types function > > Thanks for sending this first patch series! > > How would you like to proceed? Sending patches that add essential > services, and then (guix scripts home =E2=80=A6) modules? Yep. > I agree we should apply it all in =E2=80=98wip-guix-home=E2=80=99 for now. > > Some general comments: > > =E2=80=A2 Please remove tabs from Scheme files. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-toberebased-gnu-home-services-Untabify-a-file.patch Content-Transfer-Encoding: quoted-printable From=2026bfd8052d90650abc7e5ec6dbb7dd7165dfba3c Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Wed, 28 Jul 2021 08:22:20 +0300 Subject: [PATCH] (toberebased) gnu: home-services: Untabify a file =2D-- gnu/home-services.scm | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 9afb70f0a7..94f0ccff7a 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -33,10 +33,10 @@ #:use-module (ice-9 match) =20 #:export (home-service-type =2D home-profile-service-type =2D home-environment-variables-service-type =2D home-files-service-type =2D home-run-on-first-login-service-type + home-profile-service-type + home-environment-variables-service-type + home-files-service-type + home-run-on-first-login-service-type home-activation-service-type home-run-on-change-service-type home-provenance-service-type @@ -44,8 +44,8 @@ fold-home-service-types) =20 #:re-export (service =2D service-type =2D service-extension)) + service-type + service-extension)) =20 ;;; Comment: ;;; @@ -76,7 +76,7 @@ directory containing the given entries." (extensions '()) (compose identity) (extend home-derivation) =2D (default-value '()) + (default-value '()) (description "Build the home environment top-level directory, which in turn refers to everything the home environment needs: its @@ -130,12 +130,12 @@ exported." (fold (lambda (x acc) (when (equal? (car x) (car acc)) =2D (warning =2D (G_ "duplicate definition for `~a' environment variable ~%") (car x))) + (warning + (G_ "duplicate definition for `~a' environment variable ~%") (ca= r x))) x) (cons "" "") (sort vars (lambda (a b) =2D (stringsetup-environment-script))) (compose concatenate) (extend append) =2D (default-value '()) + (default-value '()) (description "Set the environment variables."))) =20 (define (files->files-directory files) @@ -227,7 +227,7 @@ directory containing FILES." files-entry))) (compose concatenate) (extend append) =2D (default-value '()) + (default-value '()) (description "Configuration files for programs that will be put in @file{~/.guix-home/files}."))) =20 @@ -235,32 +235,32 @@ will be put in @file{~/.guix-home/files}."))) (gexp->script "on-first-login" #~(let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") =2D (format #f "/run/user/~a" (getuid)))) =2D (flag-file-path (string-append =2D xdg-runtime-dir "/on-first-login-executed")) =2D (touch (lambda (file-name) =2D (call-with-output-file file-name (const #t))))) + (format #f "/run/user/~a" (getuid)))) + (flag-file-path (string-append + xdg-runtime-dir "/on-first-login-executed")) + (touch (lambda (file-name) + (call-with-output-file file-name (const #t))))) ;; XDG_RUNTIME_DIR dissapears on logout, that means such trick ;; allows to launch on-first-login script on first login only ;; after complete logout/reboot. (when (not (file-exists? flag-file-path)) =2D (begin #$@gexps (touch flag-file-path)))))) + (begin #$@gexps (touch flag-file-path)))))) =20 (define (on-first-login-script-entry m-on-first-login) "Return, as a monadic value, an entry for the on-first-login script in the home environment directory." (mlet %store-monad ((on-first-login m-on-first-login)) =2D (return `(("on-first-login" ,on-first-login))))) + (return `(("on-first-login" ,on-first-login))))) =20 (define home-run-on-first-login-service-type (service-type (name 'home-run-on-first-login) (extensions (list (service-extension =2D home-service-type + home-service-type on-first-login-script-entry))) (compose identity) (extend compute-on-first-login-script) =2D (default-value #f) + (default-value #f) (description "Run gexps on first user login. Can be extended with one gexp."))) =20 @@ -281,18 +281,18 @@ extended with one gexp."))) #f)))) (if (file-exists? (he-init-file new-home)) (let* ((port ((@ (ice-9 popen) open-input-pipe) =2D (format #f "source ~a && env" + (format #f "source ~a && env" (he-init-file new-home)))) =2D (result ((@ (ice-9 rdelim) read-delimited) "" port)) =2D (vars (map (lambda (x) + (result ((@ (ice-9 rdelim) read-delimited) "" port)) + (vars (map (lambda (x) (let ((si (string-index x #\=3D))) (cons (string-take x si) (string-drop x (1+ si))))) =2D ((@ (srfi srfi-1) remove) =2D string-null? + ((@ (srfi srfi-1) remove) + string-null? (string-split result #\newline))))) =2D (close-port port) =2D (map (lambda (x) (setenv (car x) (cdr x))) vars) + (close-port port) + (map (lambda (x) (setenv (car x) (cdr x))) vars) =20 (setenv "GUIX_NEW_HOME" new-home) (setenv "GUIX_OLD_HOME" old-home) @@ -319,11 +319,11 @@ in the home environment directory." (service-type (name 'home-activation) (extensions (list (service-extension =2D home-service-type + home-service-type activation-script-entry))) (compose identity) (extend compute-activation-script) =2D (default-value #f) + (default-value #f) (description "Run gexps to activate the current generation of home environment and update the state of the home directory. @command{activate} script automatically called during =2D-=20 2.32.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > =E2=80=A2 Please do not write documentation in commit logs. For example, > patch #1 explains the different service types, but to me, that=E2=80= =99d > belong in a comment or (better yet) in a section of the manual. For > commit logs, we use ChangeLog style: > > https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html > > It=E2=80=99s OK if you don=E2=80=99t get the fine points right from t= he start, > committers can tweak it for you. :-) True, I forgot to add ChangeLog style parts to first two patches. The rest of commit message originally was just an explanation for reviewers to provide a context, but yep it's already looks like a documentation) > > =E2=80=A2 When there are tests or documentation, add them in the commit t= hat > adds the corresponding functionality. Wanted to add documentation with a separate patch series to make patch series to wip-guix-home be smaller and easier for review, but probably you are right, I should add related documentation in the same series. > =E2=80=A2 Regarding module names: what about putting everything in the = (gnu > home =E2=80=A6) name space. For services, I wonder if we could simpl= y use > (gnu services home), for the essential services, and other (gnu > services =E2=80=A6) module, but that assumes some code can be shared = between > System and Home. Thoughts? There was a thread on rde-devel about moving home services to (gnu services ...), in the second half of the first response I provided some arguments against this change. https://lists.sr.ht/~abcdw/rde-devel/%3C87y2cqifpx.fsf%40yoctocell.xyz%3E However, I can miss some niceties, so I still open for discussion if you think that arguments from the thread isn't valid anymore or not valid at all. > I=E2=80=99ll look at the actual patches later, but I invite others to chi= me in > too. :-) Cool, I'll wait for the review of the code and will prepare a new version of patch series after that. Thank you for the comments! --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEA7L8PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wBtIP/3+dnU+LlveSU43SjRWkPBPNnRvf9E0NIZ2f RJFTiknp4tswLeVbZAgURYuLUNtWgxWc4JTM5gK1n7U+/BAHZ2sKlrnQ9i6hQmAJ DapGJti+taseiW52jvaUJMA/G7i05hSk96lrNgsX1ngMljwSUPX3kF8+t0U25uzd rSVF8cfij1D39xOvrz1P3p6KQ/C26o0RlJNdBpQ1m691h2hCvSN69NYmvloXf7Yl SJvJgM2byTso9Udp67G32nmvDBEdep7ZQsKoC+3LNCN+8OkkPkaJ+9WAjlx6v0d1 vGHxQMCyWneaaDEhmnm+xSaQ85rHlRVSnHUGaUt3/4DLZoaMBCWaVBi7fKGeZ2/x QoV4suDPcSAa4RFyiet3tbKApFhc0yAMLKTxi/nxDP3F5uDBKmkm37XRWkDwXcpm wjWOrw9EW2PSbxAPH/wgVCZYmaYlO7Ks+HCWuqCIPGbba2/aaxo61z0VyvBBe8og pSAI7+O1e1ccKMYwSA2TMrsM6Foo2Ma9PYGvyFElsXWQS7Elkx/UIYYBbdS8iFsw yKxluQbt0zgMmKfsu7F9f0NoyDJOjc6EKxBOHPDiDEnpLw8m2BM6+sp38zDNzDmz dxDiqdOpRKuBH1t/0F7Ct1ogPMDRnKtxDSKt9JWLV8nAizrWWmQU0YZ6sudybzwC zI5nwjze =p5iR -----END PGP SIGNATURE----- --==-=-=--