X-Loop: help-debbugs@HIDDEN Subject: [bug#68589] [PATCH] Add guix-home-service-type Resent-From: Lars Rustand <rustand.lars@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 19 Jan 2024 14:26:01 +0000 Resent-Message-ID: <handler.68589.B.170567432430919 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 68589 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68589 <at> debbugs.gnu.org X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.170567432430919 (code B ref -1); Fri, 19 Jan 2024 14:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jan 2024 14:25:24 +0000 Received: from localhost ([127.0.0.1]:57926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rQpoB-00082b-Fr for submit <at> debbugs.gnu.org; Fri, 19 Jan 2024 09:25:23 -0500 Received: from lists.gnu.org ([2001:470:142::17]:46584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rustand.lars@HIDDEN>) id 1rQpo9-00082N-1C for submit <at> debbugs.gnu.org; Fri, 19 Jan 2024 09:25:22 -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 <rustand.lars@HIDDEN>) id 1rQpo0-00081M-Nj for guix-patches@HIDDEN; Fri, 19 Jan 2024 09:25:12 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <rustand.lars@HIDDEN>) id 1rQpnz-0006ts-0N for guix-patches@HIDDEN; Fri, 19 Jan 2024 09:25:12 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50e7abe4be4so1092085e87.2 for <guix-patches@HIDDEN>; Fri, 19 Jan 2024 06:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705674309; x=1706279109; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=URTIJnQ2mJoOGD1AW7BwK0/Ny6us0IsmffUVAWVqE1o=; b=nUoB0sToLK3lGzk74uBqTARBeH+9bELmmqbBRHJsoqDAxzHNg+c4AJ13gLbyV8sY9Y VMAalSSoW/2kGd0dJwBDJ1YYiSvnNki5r32ClAeMo6Ac1/yyVLFrB9N8+cKjRxZWoIrk 8GXqjoPKy0monROHOwEiQEinL/VCeSOrrXarHlfqUCzL2JA9ItzQ4oNOFjZ+ZTiO0kBb zItKLJLg4AKt8cl1TYKcHTl1q0kBNQMfI6MsbDY4G0Nv8bHq/O20iem3L2jblduU9dC8 6PdlOku9dMFzdGOgA/ipFf3pUsA3eqIG1sWTznSr7rLoBLlnurP7QzrADnLgvSZefN99 fsIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705674309; x=1706279109; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=URTIJnQ2mJoOGD1AW7BwK0/Ny6us0IsmffUVAWVqE1o=; b=ubhITYoDL23/kEkqTYbBon5AvNxEX/NJJkUB/7Vd4VxeK22m9UaJLNDKIaqqAlD22O o3oSdiqTpdxkI10ZPBbXXh4d6h2N0dRTKD5jSTb/Y9BZ36fR6ZO7aeA3MrhWsqktqtcf jgVeztpW6/RJ4lz1lBlLyUedn7JjujUU0V0XUscznwS5hgRNa/Vxb0Bhqrpl7Wd46OyL UxnapTnwzJ7b110HuXgzuZM0nPCLGNOI+YFLspBAWQ69hLfMjjHbJmJyM3wyAbIVxuS+ NE6qcEuRHuaXbOHU9RSIiFDxxzXpTMS0X6S/Q4rzpHNgR0eZsA2ApdmOzda2mshaf/4J u26w== X-Gm-Message-State: AOJu0YxMwwB4vu+CE5AXbS2HBXV7uQ//7bVgfifQ2znA303Bl0Jiv7oy aP+QBXQ2QYf3Cfr5N65ckr3wBxJSOaNvTwqvuAAyWCWKipPGEJGixbWZ+RME46g= X-Google-Smtp-Source: AGHT+IEkcb9WC91e5WeUHIUHlRnL8IiG0MwbgVcdDl/4WBayPoMjwNdcMxo47fjVP/AOf5u/0h1y/g== X-Received: by 2002:a05:6512:3f1f:b0:50e:75ee:ec4c with SMTP id y31-20020a0565123f1f00b0050e75eeec4cmr1045262lfa.11.1705674309098; Fri, 19 Jan 2024 06:25:09 -0800 (PST) Received: from localhost (78.79-160-60.customer.lyse.net. [79.160.60.78]) by smtp.gmail.com with ESMTPSA id w6-20020ac254a6000000b0050f18179d72sm264706lfk.262.2024.01.19.06.25.08 for <guix-patches@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 06:25:08 -0800 (PST) User-agent: mu4e 1.10.8; emacs 30.0.50 From: Lars Rustand <rustand.lars@HIDDEN> Date: Fri, 19 Jan 2024 15:12:13 +0100 Message-ID: <87wms5e6ym.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=rustand.lars@HIDDEN; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hoping to upstream this nice service from RDE. This service allows to embed a home environment in a operating-system declaration. Original source: https://git.sr.ht/~abcdw/rde/tree/master/item/src/gnu/services/home.scm Change-Id: I42976cae9dd1580dc07dc866cd851294c7921725 --- gnu/services/home.scm | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 gnu/services/home.scm diff --git a/gnu/services/home.scm b/gnu/services/home.scm new file mode 100644 index 0000000000..868eafbec8 --- /dev/null +++ b/gnu/services/home.scm @@ -0,0 +1,47 @@ +(define-module (gnu services home) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix records) + + #:export (guix-home-service-type)) + + +(define (guix-home-shepherd-service config) + (map + (lambda (x) + (let ((user (car x)) + (he (cdr x))) + (shepherd-service + (documentation "Activate Guix Home.") + ;; Originally requirement was user-homes, but for recently it stopped + ;; working, seems like it was executed too early and didn't work, so + ;; we switched to term-tty1. + (requirement '(term-tty1)) + (provision (list (symbol-append 'guix-home- (string->symbol user)))) + (one-shot? #t) + (auto-start? #t) + (start #~(make-forkexec-constructor + '(#$(file-append he "/activate")) + #:user #$user + #:environment-variables + (list (string-append "HOME=" (passwd:dir (getpw #$user)))) + #:group (group:name (getgrgid (passwd:gid (getpw #$user)))))) + (stop #~(make-kill-destructor))))) + config)) + +(define (guix-home-gc-roots config) + (map cdr config)) + +(define guix-home-service-type + (service-type + (name 'guix-home) + (description "Setups home-environments specified in the value.") + (extensions (list (service-extension + shepherd-root-service-type + guix-home-shepherd-service))) + ;; (compose append) + ;; (extend append) + (default-value '()))) base-commit: 162d6a2fdd6af13272967c77347a54934ecb45e6 -- 2.41.0
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Lars Rustand <rustand.lars@HIDDEN> Subject: bug#68589: Acknowledgement ([PATCH] Add guix-home-service-type) Message-ID: <handler.68589.B.170567432430919.ack <at> debbugs.gnu.org> References: <87wms5e6ym.fsf@HIDDEN> X-Gnu-PR-Message: ack 68589 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 68589 <at> debbugs.gnu.org Date: Fri, 19 Jan 2024 14:26:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 68589 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 68589: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D68589 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: [bug#68589] [PATCH] Add guix-home-service-type Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sat, 10 Feb 2024 21:32:02 +0000 Resent-Message-ID: <handler.68589.B68589.17076006648560 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 68589 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Lars Rustand <rustand.lars@HIDDEN> Cc: 68589 <at> debbugs.gnu.org Received: via spool by 68589-submit <at> debbugs.gnu.org id=B68589.17076006648560 (code B ref 68589); Sat, 10 Feb 2024 21:32:02 +0000 Received: (at 68589) by debbugs.gnu.org; 10 Feb 2024 21:31:04 +0000 Received: from localhost ([127.0.0.1]:43112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rYuwB-0002DL-V1 for submit <at> debbugs.gnu.org; Sat, 10 Feb 2024 16:31:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1rYuw9-0001yJ-UC for 68589 <at> debbugs.gnu.org; Sat, 10 Feb 2024 16:31:02 -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 <ludo@HIDDEN>) id 1rYuvn-00033m-R8; Sat, 10 Feb 2024 16:30:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Xulb9A2Z1RWqdhWhrSykJQDpGPath2OiJkcs/B9ER+k=; b=JfAU3Ii/A8obXKSqw8jj quQaO9ZVBWqyKzVdBR1BOwGupzWRqt6RFq8HPPuoxmSIvh8CflPzmYZACbHUXhafI9Rt/YZUmClUa BgTv5YPKFuuCzAa6nPa9b6MKLkftgVExfHO/MWr0yar2IvvECLIDDMdTpvpt3mA8cdXNITIxdVSXT I79VHTrn6w7p1UlHPmXp+tI9K5eSiRVZ1JJNtAo/4XHwQPFyEiy/5n4RYGgbu5sZ8Hv/sZzu284s4 S3ZbS84YIag6k7YfZLQTLByRTIrCts5DyY+Egs443H8jT76QnvckN70ufXwVFNrbxSxn9Mrp5OYcd gSuaeDIlZrYEHA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> In-Reply-To: <87wms5e6ym.fsf@HIDDEN> (Lars Rustand's message of "Fri, 19 Jan 2024 15:12:13 +0100") References: <87wms5e6ym.fsf@HIDDEN> Date: Sat, 10 Feb 2024 22:30:35 +0100 Message-ID: <877cjchuro.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Lars, Lars Rustand <rustand.lars@HIDDEN> skribis: > Hoping to upstream this nice service from RDE. This service allows to > embed a home environment in a operating-system declaration. > > Original source: https://git.sr.ht/~abcdw/rde/tree/master/item/src/gnu/se= rvices/home.scm > > Change-Id: I42976cae9dd1580dc07dc866cd851294c7921725 This would be much welcome! > +++ b/gnu/services/home.scm > @@ -0,0 +1,47 @@ > +(define-module (gnu services home) Could you add a header similar to that found in other files? Since this is copied from rde, make sure to preserve their copyright notices. > +(define (guix-home-shepherd-service config) > + (map > + (lambda (x) > + (let ((user (car x)) > + (he (cdr x))) In Guix we=E2=80=99d use =E2=80=98match=E2=80=99 instead of =E2=80=98car=E2= =80=99 + =E2=80=98cdr=E2=80=99: https://guix.gnu.org/manual/devel/en/html_node/Data-Types-and-Pattern-Mat= ching.html But perhaps we could just as well define a <guix-home-configuration> record or similar? > +(define (guix-home-gc-roots config) > + (map cdr config)) Unused. > +(define guix-home-service-type > + (service-type > + (name 'guix-home) > + (description "Setups home-environments specified in the value.") =E2=80=9CSets up Guix Home for the specified user accounts.=E2=80=9D > + (extensions (list (service-extension > + shepherd-root-service-type > + guix-home-shepherd-service))) > + ;; (compose append) > + ;; (extend append) Why comment it out? Also make sure to register the file in =E2=80=98gnu/local.mk=E2=80=99. Last, we usually require a test for system services; you can find them in gnu/tests/*.scm. Could you try and write one? It would check for instance that the user=E2=80=99s shepherd is indeed started. Could you send an updated patch? Thanks, Ludo=E2=80=99.
X-Loop: help-debbugs@HIDDEN Subject: [bug#68589] [PATCH] Add guix-home-service-type References: <87wms5e6ym.fsf@HIDDEN> In-Reply-To: <87wms5e6ym.fsf@HIDDEN> Resent-From: Richard Sent <richard@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 25 Mar 2024 23:13:01 +0000 Resent-Message-ID: <handler.68589.B68589.171140837218309 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 68589 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68589 <at> debbugs.gnu.org Received: via spool by 68589-submit <at> debbugs.gnu.org id=B68589.171140837218309 (code B ref 68589); Mon, 25 Mar 2024 23:13:01 +0000 Received: (at 68589) by debbugs.gnu.org; 25 Mar 2024 23:12:52 +0000 Received: from localhost ([127.0.0.1]:36529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rotUp-0004lB-1Y for submit <at> debbugs.gnu.org; Mon, 25 Mar 2024 19:12:52 -0400 Received: from mail-108-mta79.mxroute.com ([136.175.108.79]:33271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <richard@HIDDEN>) id 1rotUj-0004l0-2E for 68589 <at> debbugs.gnu.org; Mon, 25 Mar 2024 19:12:49 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta79.mxroute.com (ZoneMTA) with ESMTPSA id 18e77e330f30003bea.001 for <68589 <at> debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 25 Mar 2024 23:12:41 +0000 X-Zone-Loop: 8705d0f404e2ba57c3b8fbaf9975b22bf9b3b081f602 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uoRSKQybavUCCdKFxgLgAYIf3+zB+nM2tpU/qHSge68=; b=FGVQp8qqf2n5tBoyCAShSvDBEF iMEBhWuzy1dg2fwBg/org6UsMEh7MsB6edYfpn72XMtM62d5GjY+0t46un718jYNoJ4+aUNa1E+ri V6BTzmoyUui8JYpYc8DnvH9AL/WCzqNzO3R7wag+yPM+aY9gJV+fkRB8zUdXHSmw79LJgzQ4jher6 qslSJ5DSw5U4Xj54vWNSePeBouB0AW3WQXabTJNUHa8u1AwW+VYEadSvBQ7Ji8Ro8f7gsETk0gH+0 f44wldQfzLjwTMuJrLdXANQ2GFAH6te3WUBJkl1elHG+RNGlpyVe0/Wlw//rVq7oFRDUOG48UznQy 6RNB2JVA==; From: Richard Sent <richard@HIDDEN> Date: Mon, 25 Mar 2024 19:12:35 -0400 Message-ID: <87wmpp52jg.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@HIDDEN X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi all, I accidentally submitted a patch very similar to this one at https://issues.guix.gnu.org/69781. FYI in case anyone winds up iterating on this version of the patch. Not sure how to merge debbugs issues. I did implement most of the feedback mentioned in this issue and resolved a couple of other problems. -- Take it easy, Richard Sent Making my computer weirder one commit at a time.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.