From da1c1b6e3b2cd435e3b25a421c7358bb14ff1816 Mon Sep 17 00:00:00 2001 From: Peter Pathirana Date: Tue, 16 Jul 2024 06:26:04 +0000 Subject: [PATCH 1/2] fix: various fixes to workspace initialization scripts --- images/homelab-workspace/{shell => etc}/bash_aliases.defaults | 0 .../homelab-workspace/{shell => etc}/bash_completion.defaults | 0 images/homelab-workspace/{shell => etc}/bashrc.defaults | 0 images/homelab-workspace/{shell/bashrc => etc/skel/.bashrc} | 1 + .../{shell/bashrc.extra => etc/skel/.bashrc.extra} | 4 ++-- 5 files changed, 3 insertions(+), 2 deletions(-) rename images/homelab-workspace/{shell => etc}/bash_aliases.defaults (100%) rename images/homelab-workspace/{shell => etc}/bash_completion.defaults (100%) rename images/homelab-workspace/{shell => etc}/bashrc.defaults (100%) rename images/homelab-workspace/{shell/bashrc => etc/skel/.bashrc} (97%) rename images/homelab-workspace/{shell/bashrc.extra => etc/skel/.bashrc.extra} (64%) diff --git a/images/homelab-workspace/shell/bash_aliases.defaults b/images/homelab-workspace/etc/bash_aliases.defaults similarity index 100% rename from images/homelab-workspace/shell/bash_aliases.defaults rename to images/homelab-workspace/etc/bash_aliases.defaults diff --git a/images/homelab-workspace/shell/bash_completion.defaults b/images/homelab-workspace/etc/bash_completion.defaults similarity index 100% rename from images/homelab-workspace/shell/bash_completion.defaults rename to images/homelab-workspace/etc/bash_completion.defaults diff --git a/images/homelab-workspace/shell/bashrc.defaults b/images/homelab-workspace/etc/bashrc.defaults similarity index 100% rename from images/homelab-workspace/shell/bashrc.defaults rename to images/homelab-workspace/etc/bashrc.defaults diff --git a/images/homelab-workspace/shell/bashrc b/images/homelab-workspace/etc/skel/.bashrc similarity index 97% rename from images/homelab-workspace/shell/bashrc rename to images/homelab-workspace/etc/skel/.bashrc index 27a32b05..31a11c5d 100644 --- a/images/homelab-workspace/shell/bashrc +++ b/images/homelab-workspace/etc/skel/.bashrc @@ -1,3 +1,4 @@ +# shellcheck disable=SC2148 # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) for examples diff --git a/images/homelab-workspace/shell/bashrc.extra b/images/homelab-workspace/etc/skel/.bashrc.extra similarity index 64% rename from images/homelab-workspace/shell/bashrc.extra rename to images/homelab-workspace/etc/skel/.bashrc.extra index 44716cfb..0ad32bba 100644 --- a/images/homelab-workspace/shell/bashrc.extra +++ b/images/homelab-workspace/etc/skel/.bashrc.extra @@ -1,9 +1,9 @@ source <(zoxide init bash) # shellcheck disable=SC2016 -echo 'eval "$($FNM_ROOT/fnm env --shell bash --use-on-cd --fnm-dir $FNM_ROOT)"' +eval "$($FNM_ROOT/fnm env --shell bash --use-on-cd --fnm-dir $HOME/.fnm)" # shellcheck disable=SC2016 -echo 'eval "$(${HOME}/.local/bin/starship init bash)"' +eval "$(${HOME}/.local/bin/starship init bash)" if [[ -f $HOME/.krew/bin/kubectl-cnpg ]]; then ln -sf $HOME/.krew/bin/kubectl-cnpg $HOME/.local/bin/cnpg From 44487e0b38d3c4e5887470b44a88e4cac88c8a1a Mon Sep 17 00:00:00 2001 From: Peter Pathirana Date: Tue, 16 Jul 2024 06:29:37 +0000 Subject: [PATCH 2/2] fix: various fixes to workspace initialization scripts --- images/homelab-workspace/Dockerfile | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/images/homelab-workspace/Dockerfile b/images/homelab-workspace/Dockerfile index 79127903..9a0baef2 100644 --- a/images/homelab-workspace/Dockerfile +++ b/images/homelab-workspace/Dockerfile @@ -490,20 +490,12 @@ RUN --mount=type=bind,from=sdk-nodejs,source=/env,target=/env/sdk-nodejs \ # add all environment values from /env/*.env files to /etc/environment for env_file in $(find /env -type f -name *.env | sort); do cat $env_file >> /etc/environment; done -# shell initialization scripts -COPY --link --chown=root:root --chmod=644 shell/bash_aliases.defaults /etc/bash_aliases.defaults -COPY --link --chown=root:root --chmod=644 shell/bash_completion.defaults /etc/bash_completion.defaults -COPY --link --chown=root:root --chmod=644 shell/bashrc.defaults /etc/bashrc.defaults -COPY --link --chown=root:root --chmod=644 shell/bashrc /etc/skel/.bashrc -COPY --link --chown=root:root --chmod=644 shell/bashrc.extra /etc/skel/.bashrc.extra +# copy /etc config files +COPY --link --chown=root:root --chmod=644 etc/* /etc/ # coder initialization scripts -RUN mkdir -p /opt/coder/bin COPY --link --chown=root:root --chmod=755 coder/*.sh /opt/coder/bin/ -# supervisord configuration for docker and coder agent -COPY --link --chown=root:root --chmod=644 etc/supervisord.conf /etc/supervisord.conf - RUN rm -f /etc/apt/apt.conf.d/keep-cache # Add `coder` user (coder platform will connect the user in as this user)