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 KPxmJD56EmE6WwAAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 15:08:14 +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 MOcnID56EmFJQAAA1q6Kng (envelope-from ) for ; Tue, 10 Aug 2021 13:08:14 +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 AD4BA276FF for ; Tue, 10 Aug 2021 15:08:13 +0200 (CEST) Received: from localhost ([::1]:37256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDRUK-0002t1-6D for larch@yhetil.org; Tue, 10 Aug 2021 09:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDRTC-0000Nt-OB for guix-patches@gnu.org; Tue, 10 Aug 2021 09:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDRTC-0001Zr-FO for guix-patches@gnu.org; Tue, 10 Aug 2021 09:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDRTC-0005xX-4O for guix-patches@gnu.org; Tue, 10 Aug 2021 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49814] [PATCH] accounts: Add . Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 13:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49814 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brice Waegeneire Cc: 49814@debbugs.gnu.org Received: via spool by 49814-submit@debbugs.gnu.org id=B49814.162860078322856 (code B ref 49814); Tue, 10 Aug 2021 13:07:02 +0000 Received: (at 49814) by debbugs.gnu.org; 10 Aug 2021 13:06:23 +0000 Received: from localhost ([127.0.0.1]:58705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDRSZ-0005wZ-1t for submit@debbugs.gnu.org; Tue, 10 Aug 2021 09:06:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDRSX-0005wL-Jl for 49814@debbugs.gnu.org; Tue, 10 Aug 2021 09:06:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48322) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDRSR-0001DW-II; Tue, 10 Aug 2021 09:06:15 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45058 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDRSR-0006fh-9i; Tue, 10 Aug 2021 09:06:15 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210801212413.8906-1-brice@waegenei.re> Date: Tue, 10 Aug 2021 15:06:13 +0200 In-Reply-To: <20210801212413.8906-1-brice@waegenei.re> (Brice Waegeneire's message of "Sun, 1 Aug 2021 23:24:13 +0200") Message-ID: <871r71sb3u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1628600893; 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; bh=JBf4P+8P1qE+ocm4yASz4SgZKzt/HuTt+kCXlbDK2Os=; b=iD8imDLyT6p1HEKzOXDSqI+Mx9DQS+tJs10mTFDaSysEupOAjvpmbjZd6KyOB9NHekx8/+ k8Isy191pdlr727wQqwLDRntRIUM9w+afPQJT/sH4D10OaPmUxjQcjjxTStigGqOn/Us0q qWfjtqY3sZ8M/aO90nxI4LXO0iwAiXc/8G2Xw7A/IjCFv7eOyt+gIZHvBmyTnr4FHz3iHF oQ5mpipJxnuKz9JDYc4dVjN/FCbnm3FAw0gxTcPg7wxinYRPZ6hbZgt69cbG+3Jj5OTfmc UOuBhP1+yzm5vCQFg1q4QsxRwY1wO7NnjN0JhvdQPUM9WVrupFFzlwWnB3u6sg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628600893; a=rsa-sha256; cv=none; b=YHk1yksPCFx3jFGdWOzbriUWq4GLhwiVSbC4Icq4mqJShwEiLZLYnHVNdXDY3kh3I+TKkO /JP3/LMeXlALU8xgkM4Zl05djIgBo4WtyQK+CcVhgGFk416D2Wq4rSagPBzzNgcSDv7ziW Jj1k182HPjXD9CM0RNxK33KLKs3SXKWKnPTUilFTwnrkwywOoxhixmJ4lWGADrOKKDi4xh uHXbEKUMvaU14MEeBCstfYLYErrcDiXgxIeEmKZp1wQjJkDpGqvPyOqhCI7aQpV9CKpmcX u6VkScmbtty+0a2OAvW3hmgC3xVHp41Zppl7216XKI2ZHiNLFs0S8DaxMlKs/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: AD4BA276FF X-Spam-Score: -2.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: WaAeDFJflaFk Hello, Brice Waegeneire skribis: > As I was answerd on IRC, it's already possible to add groups to an already > defined 'operating-system' by modifying it's 'user' field. However this = isn't > that practical in my point of view. > > I would prefer to do such change from a service to be able to keep a pote= ntial > new group and its members in proximity in the code. For example when add= ing a > sgid dumpcap binary to be used by the wireshark group members, it makes s= ense > to keep the membership of that group close to the definition of the new g= roup > and its sgid binary: > > (simple-service 'wireshark-account account-service-type > (list (user-group (name "wireshark") (system? #t)) > (additional-group-members "wireshark" %sysadmins))) > (simple-service 'wireshark-dumpcap setuid-program-service-type > (list (setuid-program > (program (file-append wireshark "/bin/dumpcap")) > (setuid? #f) > (setgid? #t) > (group "wireshark")))) I understand the desire to keep these things close to one another, but I must say I=E2=80=99m not convinced by this style. I would do that along th= ese lines: (define (extend-account-membership group accounts) ;; Make ACCOUNTS members of GROUP. (map (lambda (account) (user-account (inherit account) (supplementary-groups (cons group (user-account-supplementary-groups account))))) accounts)) (operating-system ;; =E2=80=A6 (users (extend-account-membership "wireshark" (list =E2=80=A6)))) WDYT? > This patch add a new record to be used as as some of t= he > values for the 'account-service-type' which already support 3 other diffe= rent > types. Any service could modify any other account using this, right? There might be cases where it=E2=80=99s nice to have such a sledgehammer, but it = has the downside that it makes it harder to reason about who does what in the OS config=E2=80=94pretty much like NixOS modules can touch anything any= where in the config. Thanks, Ludo=E2=80=99.