-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_after_apps-configuration-linux.sh.tmpl
61 lines (53 loc) · 2.54 KB
/
run_once_after_apps-configuration-linux.sh.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{{ if (eq .chezmoi.os "linux") -}}
#!/bin/bash
pip install argcomplete
# Check if Oh My Zsh is installed
if [ ! -d "$HOME/.oh-my-zsh" ]; then
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
# switching shell for current user
current_shell=$(getent passwd $LOGNAME | cut -d: -f7)
if [[ "$current_shell" != "/usr/bin/zsh" ]]; then
chsh -s $(which zsh)
fi
# ---------------------------------------------------------------------------------------------------------------------
# GPG settings
# ---------------------------------------------------------------------------------------------------------------------
gpg-connect-agent reloadagent /bye
# ---------------------------------------------------------------------------------------------------------------------
# Podman settings
# ---------------------------------------------------------------------------------------------------------------------
# Backwards compatibility with docker
# Starting rootless podman service
ENABLE_PODMAN_SOCKET=false
if command -v podman &> /dev/null; then
# check if podman service is running
if [[ "$ENABLE_PODMAN_SOCKET" == "true" ]]; then
if ! systemctl --user is-active --quiet podman.socket; then
echo "Starting podman.socket"
systemctl --user enable --now podman.socket
systemctl --user start podman
fi
fi
fi
# ---------------------------------------------------------------------------------------------------------------------
# chezmoi completion
# ---------------------------------------------------------------------------------------------------------------------
if command -v chezmoi &> /dev/null; then
mkdir -p "${HOME}/.oh-my-zsh/completions"
chezmoi completion zsh > "${HOME}/.oh-my-zsh/completions/_chezmoi"
fi
# ---------------------------------------------------------------------------------------------------------------------
# Docker settings
# ---------------------------------------------------------------------------------------------------------------------
# check if docker is installed
if command -v docker &> /dev/null; then
# check if user is in docker group
if ! groups | grep -q "\bdocker\b"; then
echo "Adding user to docker group"
# https://docs.fedoraproject.org/en-US/fedora-silverblue/troubleshooting/#_unable_to_add_user_to_group
sudo sh -c "grep -E '^docker:' /usr/lib/group | tee -a /etc/group > /dev/null && usermod -aG docker $USER"
fi
fi
{{ end -}}