Hi!

I'm not entirely sure why this exact error pops up, but i think this
might render a nice opportunity for a small Guix shell/environment
feature!

I have created a simplistic patch, unfortunately that does not seem to
work -- which puzzles me somewhat.  What else is needed to add a user to
a group in a guix shell container?  On the *nix systems i'm acquainted
with there was nothing more to it than adding the correct entry in
/etc/group and logging in (again).  What am i missing in the context of
Guix containers?


Though my patch is not ready (or working) i attach it below.

g


>From ad84a3e73bf86e89c7a8a167111e5bca5821f021 Mon Sep 17 00:00:00 2001
From: Gabriel Wicki <gabr...@erlikon.ch>
Date: Sun, 8 Jan 2023 12:08:30 +0100
Subject: [PATCH] scripts: environment: Add "audio" group to the shell
 container user

* guix/scripts/environment.scm [launch-environment/container]: Add an entry
for "audio" in /etc/group.
---
 guix/scripts/environment.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index c7fd8fd340..f2fae6f1f8 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -748,6 +748,9 @@ (define fhs-mappings
                                         (string-append "/home/" user)
                                         (passwd:dir pwd))))))
             (groups   (list (group-entry (name "users") (gid gid))
+                            (group-entry (name "audio")
+                                         (gid (+ 1 gid))
+                                         (members (list (number->string uid))))
                             (group-entry (gid 65534) ;the overflow GID
                                          (name "overflow"))))
             (home-dir (password-entry-directory passwd))
-- 
2.38.1


Reply via email to