Skip to content

Commit

Permalink
Merge pull request #134 from jandubois/home-and-comment
Browse files Browse the repository at this point in the history
Set user comment and home directory from lima.env settings
  • Loading branch information
jandubois authored Nov 1, 2024
2 parents ca91956 + 9ed973d commit 0317343
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lima-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0317343

Please sign in to comment.