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

Refresh V0 #655

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .manala/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sh:
if [ ! -t 0 ] ; then \
$(call manala_docker_command, --no-TTY) sh -s ; \
else \
$(manala_docker_command) bash --login ; \
$(manala_docker_command) zsh --login ; \
fi
.PHONY: sh

Expand Down
50 changes: 38 additions & 12 deletions .manala/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ ARG MANALA_USER_ID="1000"
ARG MANALA_GROUP_ID="1000"

ARG GOSU_VERSION="1.17"
ARG GOMPLATE_VERSION="4.1.0"
ARG DIRENV_VERSION="2.34.0"
ARG GOMPLATE_VERSION="4.2.0"
ARG DIRENV_VERSION="2.35.0"
ARG JQ_VERSION="1.7.1"
ARG YQ_VERSION="4.44.3"
ARG YQ_VERSION="4.44.6"
ARG STARSHIP_VERSION="1.21.1"
ARG FZF_VERSION="0.56.3"

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

# Starship
ENV STARSHIP_CONFIG=/etc/starship/starship.toml

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN \
apt-get --quiet update \
&& apt-get --quiet --yes --purge --autoremove upgrade \
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
bash-completion \
bzip2 \
ca-certificates \
curl \
Expand All @@ -43,9 +47,10 @@ RUN \
socat \
sudo \
vim \
zsh \
# User
&& addgroup --gid ${MANALA_GROUP_ID} lazy \
&& adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \
&& adduser --home /home/lazy --shell /bin/zsh --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \
&& install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \
&& echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \
# Gosu
Expand All @@ -68,10 +73,20 @@ RUN \
&& 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)" \
--output /usr/local/bin/yq \
&& chmod +x /usr/local/bin/yq \
# Bash completion
&& install --verbose --mode 0755 --directory /etc/bash_completion.d \
# Oh My Bash
&& git clone https://github.com/ohmybash/oh-my-bash.git /usr/local/share/oh-my-bash \
# Oh My Zsh
&& git clone https://github.com/ohmyzsh/ohmyzsh.git /usr/local/share/oh-my-zsh \
# See: https://github.com/ohmyzsh/ohmyzsh/issues/11995
&& git clone https://github.com/zsh-users/zsh-autosuggestions.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-autosuggestions \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
&& echo "ZDOTDIR=/etc/zsh" > /etc/zsh/zshenv \
# Starship
&& 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" \
| bsdtar -xvf - -C /usr/local/bin \
&& echo "Defaults env_keep += STARSHIP_CONFIG" > /etc/sudoers.d/starship \
# Fzf
&& 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" \
| bsdtar -xvf - -C /usr/local/bin \
&& chmod +x /usr/local/bin/fzf \
# Clean
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -143,17 +158,28 @@ Signed-By: /etc/apt/keyrings/sury_php.gpg\n\
# Symfony
&& 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" \
| bsdtar -xvf - -C /usr/local/bin symfony \
# Oh My Zsh plugin
# See: https://github.com/ohmyzsh/ohmyzsh/pull/12768
&& mkdir /usr/local/share/oh-my-zsh/custom/plugins/symfony-cli \
&& printf "\
if [[ ! -f \"\$ZSH_CACHE_DIR/completions/_symfony-cli\" ]]; then\n\
typeset -g -A _comps\n\
autoload -Uz _symfony-cli\n\
_comps[symfony]=_symfony-cli\n\
fi\n\
symfony self:completion zsh >| \"\$ZSH_CACHE_DIR/completions/_symfony-cli\" &|\n\
" > /usr/local/share/oh-my-zsh/custom/plugins/symfony-cli/symfony-cli.plugin.zsh \
# Clean
&& rm -rf /var/lib/apt/lists/*

# Nodejs
RUN \
curl -sSLf https://deb.nodesource.com/gpgkey/nodesource.gpg.key \
curl -sSLf https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
--output /etc/apt/keyrings/nodesource.asc \
&& printf "\
Types: deb\n\
URIs: https://deb.nodesource.com/node_16.x\n\
Suites: $(. /etc/os-release; echo "${VERSION_CODENAME}")\n\
URIs: https://deb.nodesource.com/node_22.x\n\
Suites: nodistro\n\
Components: main\n\
Signed-By: /etc/apt/keyrings/nodesource.asc\n\
" > /etc/apt/sources.list.d/nodesource.sources \
Expand Down
3 changes: 2 additions & 1 deletion .manala/docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ services:
build:
context: ..
dockerfile: docker/Dockerfile
image: elao:20241118144812
image: elao:20250203151344
pull_policy: never
restart: always
ports:
- 35080:80
Expand Down
150 changes: 0 additions & 150 deletions .manala/etc/profile.d/oh-my-bash.sh

This file was deleted.

21 changes: 21 additions & 0 deletions .manala/etc/starship/starship.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Starship config template
# Don't edit this file directly. Instead, set config in project .manala.yaml, and run `manala up`.

format = """
[╭─](cyan)$username$hostname$directory$direnv$env_var$custom
[╰](cyan) $cmd_duration$character"""

[username]
show_always = true
format = '[$user]($style)@'
style_user = 'yellow'

[hostname]
ssh_only = false
style = 'yellow'

[directory]
truncation_length = 1
truncation_symbol = '…/'
read_only = ''
style = 'cyan'
4 changes: 2 additions & 2 deletions .manala/etc/profile.d/message.sh → .manala/etc/zsh/.zlogin
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ printf "\033[34m =- =- -=.--\"\033[0m\n"
printf "\n"
printf " \033[36m‣ nginx \033[35m1.24\033[0m\n"
printf " \033[36m‣ php \033[35m8.3\033[0m\n"
printf " \033[36m‣ nodejs \033[35m16\033[0m\n"
printf "\n"
printf " \033[36m‣ nodejs \033[35m22\033[0m\n"

printf "\n"
printf " \033[36m• php-xdebug \033[35m[on|off] \033[37m- enable/disable php xdebug\033[0m\n"
printf "\n"
php-xdebug () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
eval "$(direnv hook bash)"
##########
# Direnv #
##########

# Config directory
export DIRENV_CONFIG=/etc/direnv
Expand Down
Loading