Skip to content

Commit 0317343

Browse files
authored
Merge pull request #134 from jandubois/home-and-comment
Set user comment and home directory from lima.env settings
2 parents ca91956 + 9ed973d commit 0317343

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lima-init.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ if [ -n "${LIMA_CIDATA_TIMEZONE}" ]; then
3030
fi
3131

3232
# Create user
33-
LIMA_CIDATA_HOMEDIR="/home/${LIMA_CIDATA_USER}.linux"
34-
useradd --home-dir "${LIMA_CIDATA_HOMEDIR}" --create-home --uid "${LIMA_CIDATA_UID}" "${LIMA_CIDATA_USER}"
33+
# LIMA_CIDATA_HOME has been added in Lima 0.18.0
34+
LIMA_CIDATA_HOMEDIR=${LIMA_CIDATA_HOME:-/home/${LIMA_CIDATA_USER}.linux}
35+
useradd --home-dir "${LIMA_CIDATA_HOMEDIR}" --create-home --comment "${LIMA_CIDATA_COMMENT:-}" --uid "${LIMA_CIDATA_UID}" "${LIMA_CIDATA_USER}"
3536

3637
# Add user to sudoers
3738
echo "${LIMA_CIDATA_USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/90-lima-users

0 commit comments

Comments
 (0)