From 9ed973de885c576ad7ce10214057c2108d4a8e6d Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Fri, 1 Nov 2024 15:43:47 -0700 Subject: [PATCH] Set user comment and home directory from lima.env settings Signed-off-by: Jan Dubois --- lima-init.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lima-init.sh b/lima-init.sh index 42ce5bb..8e46e30 100755 --- a/lima-init.sh +++ b/lima-init.sh @@ -30,8 +30,9 @@ if [ -n "${LIMA_CIDATA_TIMEZONE}" ]; then fi # Create user -LIMA_CIDATA_HOMEDIR="/home/${LIMA_CIDATA_USER}.linux" -useradd --home-dir "${LIMA_CIDATA_HOMEDIR}" --create-home --uid "${LIMA_CIDATA_UID}" "${LIMA_CIDATA_USER}" +# LIMA_CIDATA_HOME has been added in Lima 0.18.0 +LIMA_CIDATA_HOMEDIR=${LIMA_CIDATA_HOME:-/home/${LIMA_CIDATA_USER}.linux} +useradd --home-dir "${LIMA_CIDATA_HOMEDIR}" --create-home --comment "${LIMA_CIDATA_COMMENT:-}" --uid "${LIMA_CIDATA_UID}" "${LIMA_CIDATA_USER}" # Add user to sudoers echo "${LIMA_CIDATA_USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/90-lima-users