GNU bug report logs - #68589
[PATCH] Add guix-home-service-type

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Lars Rustand <rustand.lars@HIDDEN>; Keywords: patch; dated Fri, 19 Jan 2024 14:26:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Jan 2024 14:25:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 19 09:25:23 2024
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>
To: guix-patches@HIDDEN
Subject: [PATCH] Add guix-home-service-type
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-Debbugs-Envelope-To: submit
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




Acknowledgement sent to Lars Rustand <rustand.lars@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#68589; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.