diff --git a/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl index da06e60f..31662a10 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl @@ -30,8 +30,8 @@ if [ ! -d /var/lib/docker-plugins/rclone/cache ]; then sudo mkdir -p /var/lib/docker-plugins/rclone/cache fi sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/docker-rclone.conf /var/lib/docker-plugins/rclone/config/rclone.conf -if ! docker plugin ls | grep 'rclone:latest' > /dev/null; then - docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions +if ! sudo su -c 'docker plugin ls' - "$USER" | grep 'rclone:latest' > /dev/null; then + sudo su -c 'docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions' - "$USER" fi diff --git a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl index 4caec4b1..55ff8bfe 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl @@ -21,7 +21,7 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app FIREFOX_EXE="$(which io.gitlab.librewolf-community)" elif [ "$SETTINGS_DIR" == "$HOME/Library/Application Support/Firefox/Profiles" ]; then FIREFOX_EXE="/Applications/Firefox.app/Contents/MacOS/firefox" - elif [ "$SETTINGS_DIR == "$HOME/Library/Application Support/LibreWolf/Profiles" ]; then + elif [ "$SETTINGS_DIR" == "$HOME/Library/Application Support/LibreWolf/Profiles" ]; then FIREFOX_EXE="/Applications/LibreWolf.app/Contents/MacOS/librewolf" elif [ "$SETTINGS_DIR" == "$HOME/snap/firefox/common/.mozilla/firefox" ]; then FIREFOX_EXE="$(which firefox)" diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index 0596e179..791f4126 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -784,7 +784,7 @@ async function beforeInstall(packageManager) { await $`brew install --cask docker` } try { - await $`docker run --rm hello-world` + await $`sudo -c 'docker run --rm hello-world' - ${process.env.USER}` } catch (e) { log('warn', logStage, `The command \`docker run --rm hello-world\` failed`) try { @@ -1487,6 +1487,9 @@ async function addUserGroup(group) { log('error', logStage, `The useradd command is unavailable`) } } else if (osType === 'darwin') { + runCommand(`Adding the ${group} group`, `sudo dscl . -create /Users/${group}`) + runCommand(`Creating the ${group} group`, `sudo dscl . -create /Groups/${group}`) + runCommand(`Adding the ${group} user to the ${group} group`, `sudo dscl . -append /Groups/${group} GroupMembership ${group}`) } else if (osType === 'windows') { log('warn', logStage, `Windows support not yet added`) } else {