From patchwork Tue Apr 8 12:24:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41451 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 4AD9D27BC4E; Tue, 8 Apr 2025 13:28:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 F0A7027BC4C for ; Tue, 8 Apr 2025 13:28:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2841-0008PA-Vs; Tue, 08 Apr 2025 08:28:27 -0400 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 1u282v-00081o-LB for guix-patches@gnu.org; Tue, 08 Apr 2025 08:27:20 -0400 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 1u282r-000864-8J; Tue, 08 Apr 2025 08:27:14 -0400 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=NoYFmmXmXOLc0GomFxypgDrWAb6YxJl1T+wOlB0UC4M=; b=ND5RpzS1N+NgUhtSJx6VgJiTmKXrqAExCogZGpEjoMQ6RNes7QE+Yyskduo5608dxr+P80Qdsv1ztJsmCFVWXu9HEYTzMawloccxOcQrmzciC6UsVnonF5o+pJBXL7wqBzZ4Oj9BZyj3QI+I7XKw8+dxbjmYLn8Uc5MoSc3O9oNhPWjh3bw0wHxFQxIAhgbm0PU89tSfOe8CyBa8IcnMdHSwXTA/ruecOnXPxCsvHVJYm9Idz2ZQvOh8hH6GDIEE+3nE/IagtvhAdWNkGCDg+CIWmRe9R0ndRK9W7QyS51rSAoaA7WX58FBMmqWqPjuRX01/oaONjP5D796jKSUCig==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u282h-0001PC-2I; Tue, 08 Apr 2025 08:27:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77638] [PATCH 2/8] guix home: =?utf-8?b?4oCYY29udGFpbmVy4oCZ?= explicitly mounts $HOME and /run/user/1000. 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, zimon.toutoune@gmail.com, tanguy@bioneland.org, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 08 Apr 2025 12:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77638 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77638@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 , 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 , Simon Tournier , Tanguy Le Carrour , Tobias Geerinckx-Rice Received: via spool by 77638-submit@debbugs.gnu.org id=B77638.17441151865151 (code B ref 77638); Tue, 08 Apr 2025 12:27:03 +0000 Received: (at 77638) by debbugs.gnu.org; 8 Apr 2025 12:26:26 +0000 Received: from localhost ([127.0.0.1]:59691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2822-0001KP-Jd for submit@debbugs.gnu.org; Tue, 08 Apr 2025 08:26:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35488) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u281u-0001Il-V2 for 77638@debbugs.gnu.org; Tue, 08 Apr 2025 08:26:15 -0400 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 1u281m-0007n1-Tn; Tue, 08 Apr 2025 08:26:09 -0400 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=NoYFmmXmXOLc0GomFxypgDrWAb6YxJl1T+wOlB0UC4M=; b=V2OMGEq0Y+A7cYmMTxAI ujkbs5ttk9gk8AcrOVCfdkqiNPasZrTaAw3A7UwvhdalFb9NJW8Il720gAtkwMzu/XF6c6xqSbgZk mR8qXWRc5I69fl+ZZ/P1s+yNRD28533R9yiZGIr2SHldz1BhzGzAtnFf5S/qneaOCDRP5696xZWye jpp9VqNG2hr6aW5TMrl+d3zjfr7mxDVIc5OQ76qRsjSpIGLMFIC5X0S0aAziQn16NnDhFRNBu7Ytx jg5A3EGqo2wq3H+TI1xzluXcNcBckcW1f71ToSB3eWTqWKsjjvst92dVCuZkLrOWvV+Tko4VW65C+ TUkpGDoq1nnLWA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 8 Apr 2025 14:24:42 +0200 Message-ID: <70337e70f5d365c717bc43b08ad99b0f28d48b7e.1744114408.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 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 * guix/scripts/home.scm (spawn-home-container): Pass #:mounts to ‘eval/container’. Change-Id: I1986c1411711cebaf623f97897d91436d8167037 --- guix/scripts/home.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index b4c82d275f..56a4b7c7d4 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Oleg Pykhalov -;;; Copyright © 2022-2023 Ludovic Courtès +;;; Copyright © 2022-2023, 2025 Ludovic Courtès ;;; Copyright © 2022 Arun Isaac ;;; Copyright © 2022 Antero Mejr ;;; @@ -36,7 +36,8 @@ (define-module (guix scripts home) #:autoload (guix modules) (source-module-closure) #:autoload (gnu build linux-container) (call-with-container %namespaces) #:autoload (gnu system linux-container) (eval/container) - #:autoload (gnu system file-systems) (file-system-mapping + #:autoload (gnu system file-systems) (file-system + file-system-mapping file-system-mapping-source file-system-mapping->bind-mount specification->file-system-mapping @@ -361,6 +362,18 @@ (define* (spawn-home-container home #:namespaces (if network? (delq 'net %namespaces) ; share host network %namespaces) + #:mounts (list (file-system + (device "none") + (mount-point + (in-vicinity "/run/user" ;for shepherd & co. + (number->string uid))) + (type "tmpfs") + (check? #f)) + (file-system ;writable home + (device "none") + (mount-point home-directory) + (type "tmpfs") + (check? #f))) #:mappings (append network-mappings mappings) #:guest-uid uid #:guest-gid gid))