Skip to content

Commit d3dbe43

Browse files
authored
Merge d714345 into 88e5c65
2 parents 88e5c65 + d714345 commit d3dbe43

File tree

8 files changed

+184
-167
lines changed

8 files changed

+184
-167
lines changed

.manala/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ sh:
6060
if [ ! -t 0 ] ; then \
6161
$(call manala_docker_command, --no-TTY) sh -s ; \
6262
else \
63-
$(manala_docker_command) bash --login ; \
63+
$(manala_docker_command) zsh --login ; \
6464
fi
6565
.PHONY: sh
6666

.manala/docker/Dockerfile

+38-12
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ ARG MANALA_USER_ID="1000"
1010
ARG MANALA_GROUP_ID="1000"
1111

1212
ARG GOSU_VERSION="1.17"
13-
ARG GOMPLATE_VERSION="4.1.0"
14-
ARG DIRENV_VERSION="2.34.0"
13+
ARG GOMPLATE_VERSION="4.2.0"
14+
ARG DIRENV_VERSION="2.35.0"
1515
ARG JQ_VERSION="1.7.1"
16-
ARG YQ_VERSION="4.44.3"
16+
ARG YQ_VERSION="4.44.6"
17+
ARG STARSHIP_VERSION="1.21.1"
18+
ARG FZF_VERSION="0.56.3"
1719

1820
# The 'container' environment variable tells systemd that it's running inside a
1921
# Docker container environment.
@@ -23,13 +25,15 @@ ENV container="docker"
2325
# Default locale
2426
ENV LANG="C.UTF-8"
2527

28+
# Starship
29+
ENV STARSHIP_CONFIG=/etc/starship/starship.toml
30+
2631
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2732

2833
RUN \
2934
apt-get --quiet update \
3035
&& apt-get --quiet --yes --purge --autoremove upgrade \
3136
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
32-
bash-completion \
3337
bzip2 \
3438
ca-certificates \
3539
curl \
@@ -43,9 +47,10 @@ RUN \
4347
socat \
4448
sudo \
4549
vim \
50+
zsh \
4651
# User
4752
&& addgroup --gid ${MANALA_GROUP_ID} lazy \
48-
&& adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \
53+
&& adduser --home /home/lazy --shell /bin/zsh --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \
4954
&& install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \
5055
&& echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \
5156
# Gosu
@@ -68,10 +73,20 @@ RUN \
6873
&& curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
6974
--output /usr/local/bin/yq \
7075
&& chmod +x /usr/local/bin/yq \
71-
# Bash completion
72-
&& install --verbose --mode 0755 --directory /etc/bash_completion.d \
73-
# Oh My Bash
74-
&& git clone https://github.com/ohmybash/oh-my-bash.git /usr/local/share/oh-my-bash \
76+
# Oh My Zsh
77+
&& git clone https://github.com/ohmyzsh/ohmyzsh.git /usr/local/share/oh-my-zsh \
78+
# See: https://github.com/ohmyzsh/ohmyzsh/issues/11995
79+
&& git clone https://github.com/zsh-users/zsh-autosuggestions.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-autosuggestions \
80+
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
81+
&& echo "ZDOTDIR=/etc/zsh" > /etc/zsh/zshenv \
82+
# Starship
83+
&& curl -sSLf "https://github.com/starship/starship/releases/download/v${STARSHIP_VERSION}/starship-$(case $(dpkg --print-architecture) in "amd64") echo "x86_64" ;; "arm64") echo "aarch64" ;; esac)-unknown-linux-musl.tar.gz" \
84+
| bsdtar -xvf - -C /usr/local/bin \
85+
&& echo "Defaults env_keep += STARSHIP_CONFIG" > /etc/sudoers.d/starship \
86+
# Fzf
87+
&& curl -sSLf "https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac).tar.gz" \
88+
| bsdtar -xvf - -C /usr/local/bin \
89+
&& chmod +x /usr/local/bin/fzf \
7590
# Clean
7691
&& rm -rf /var/lib/apt/lists/*
7792

@@ -143,17 +158,28 @@ Signed-By: /etc/apt/keyrings/sury_php.gpg\n\
143158
# Symfony
144159
&& curl -sSLf "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_linux_$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac).tar.gz" \
145160
| bsdtar -xvf - -C /usr/local/bin symfony \
161+
# Oh My Zsh plugin
162+
# See: https://github.com/ohmyzsh/ohmyzsh/pull/12768
163+
&& mkdir /usr/local/share/oh-my-zsh/custom/plugins/symfony-cli \
164+
&& printf "\
165+
if [[ ! -f \"\$ZSH_CACHE_DIR/completions/_symfony-cli\" ]]; then\n\
166+
typeset -g -A _comps\n\
167+
autoload -Uz _symfony-cli\n\
168+
_comps[symfony]=_symfony-cli\n\
169+
fi\n\
170+
symfony self:completion zsh >| \"\$ZSH_CACHE_DIR/completions/_symfony-cli\" &|\n\
171+
" > /usr/local/share/oh-my-zsh/custom/plugins/symfony-cli/symfony-cli.plugin.zsh \
146172
# Clean
147173
&& rm -rf /var/lib/apt/lists/*
148174

149175
# Nodejs
150176
RUN \
151-
curl -sSLf https://deb.nodesource.com/gpgkey/nodesource.gpg.key \
177+
curl -sSLf https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
152178
--output /etc/apt/keyrings/nodesource.asc \
153179
&& printf "\
154180
Types: deb\n\
155-
URIs: https://deb.nodesource.com/node_16.x\n\
156-
Suites: $(. /etc/os-release; echo "${VERSION_CODENAME}")\n\
181+
URIs: https://deb.nodesource.com/node_22.x\n\
182+
Suites: nodistro\n\
157183
Components: main\n\
158184
Signed-By: /etc/apt/keyrings/nodesource.asc\n\
159185
" > /etc/apt/sources.list.d/nodesource.sources \

.manala/docker/compose.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ services:
1111
build:
1212
context: ..
1313
dockerfile: docker/Dockerfile
14-
image: elao:20241118144812
14+
image: elao:20250203151344
15+
pull_policy: never
1516
restart: always
1617
ports:
1718
- 35080:80

.manala/etc/profile.d/oh-my-bash.sh

-150
This file was deleted.

.manala/etc/starship/starship.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Starship config template
2+
# Don't edit this file directly. Instead, set config in project .manala.yaml, and run `manala up`.
3+
4+
format = """
5+
[╭─](cyan)$username$hostname$directory$direnv$env_var$custom
6+
[╰](cyan) $cmd_duration$character"""
7+
8+
[username]
9+
show_always = true
10+
format = '[$user]($style)@'
11+
style_user = 'yellow'
12+
13+
[hostname]
14+
ssh_only = false
15+
style = 'yellow'
16+
17+
[directory]
18+
truncation_length = 1
19+
truncation_symbol = '…/'
20+
read_only = ''
21+
style = 'cyan'

.manala/etc/profile.d/message.sh .manala/etc/zsh/.zlogin

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ printf "\033[34m =- =- -=.--\"\033[0m\n"
1212
printf "\n"
1313
printf " \033[36m‣ nginx \033[35m1.24\033[0m\n"
1414
printf " \033[36m‣ php \033[35m8.3\033[0m\n"
15-
printf " \033[36m‣ nodejs \033[35m16\033[0m\n"
16-
printf "\n"
15+
printf " \033[36m‣ nodejs \033[35m22\033[0m\n"
1716

17+
printf "\n"
1818
printf " \033[36m• php-xdebug \033[35m[on|off] \033[37m- enable/disable php xdebug\033[0m\n"
1919
printf "\n"
2020
php-xdebug () {

.manala/etc/profile.d/zz-direnv.sh .manala/etc/zsh/.zprofile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
eval "$(direnv hook bash)"
1+
##########
2+
# Direnv #
3+
##########
24

35
# Config directory
46
export DIRENV_CONFIG=/etc/direnv

0 commit comments

Comments
 (0)