Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set user comment and home directory from lima.env settings #134

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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