From 935d0c3d9e547aa098a500d81fe480ecfa624c85 Mon Sep 17 00:00:00 2001 From: Martin Mena Date: Mon, 16 Sep 2024 07:19:19 -0500 Subject: [PATCH] Fix some issues with the Ubuntu setup --- home/.chezmoidata/debian-packages.yaml | 1 + .../run_once_after_00-passwordless-sudo.sh.tmpl | 2 ++ home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl | 1 + home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl | 6 +++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/home/.chezmoidata/debian-packages.yaml b/home/.chezmoidata/debian-packages.yaml index 056eeb2..444b209 100644 --- a/home/.chezmoidata/debian-packages.yaml +++ b/home/.chezmoidata/debian-packages.yaml @@ -15,3 +15,4 @@ packages: - 'vim' - 'xclip' - 'curl' + - 'git' diff --git a/home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl b/home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl index 2cf9b76..d3c7a9f 100644 --- a/home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl +++ b/home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl @@ -34,6 +34,8 @@ setup_passwordless_sudo() { local tmpfile=$(mktemp) echo -e "Defaults:$LOGNAME !requiretty\n$LOGNAME ALL=(ALL) NOPASSWD: ALL" > "$tmpfile" if sudo visudo -cf "$tmpfile" && sudo mv "$tmpfile" "$sudoers_d_dir/$LOGNAME"; then + # Change the owner back to root + pkexec chown root:root /etc/sudoers /etc/sudoers.d -R echo "You can now run sudo commands without a password!" else echo "Error in sudoers file" diff --git a/home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl b/home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl index ee17a45..931b7f1 100644 --- a/home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl +++ b/home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl @@ -8,6 +8,7 @@ install_asdf() { if [[ ! -d ~/.asdf ]]; then action "Cloning git repo..." git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 || { echo "Failed to clone asdf repository"; exit 1; } + source ~/.asdf/asdf.sh else ok "asdf dir already exists, skipping cloning" source ~/.asdf/asdf.sh diff --git a/home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl b/home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl index c22c913..d8bcb37 100644 --- a/home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl +++ b/home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl @@ -7,7 +7,7 @@ install_docker() { if ! _exists docker ; then if prompt "Would you like to install Docker?"; then action "Adding Docker official GPG key" - sudo apt-get install ca-certificates curl + sudo apt-get -qq install -y ca-certificates curl > /dev/null sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc @@ -18,9 +18,9 @@ install_docker() { $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null action "Updating apt packages with the new Docker repository" - sudo apt-get update + sudo apt-get -qq update > /dev/null action "Installing Docker" - sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + sudo apt-get -qq install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin > /dev/null else ok "Skipping" fi