From 758febafbc904c86580cf8e774ee0e18a1938c98 Mon Sep 17 00:00:00 2001 From: Ethan Paul Date: Fri, 20 Dec 2024 14:15:35 -0500 Subject: [PATCH] Initial commit --- Containerfile | 15 +++++++++++++++ load-user-bashrc.sh | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Containerfile create mode 100644 load-user-bashrc.sh diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..4f3fcf5 --- /dev/null +++ b/Containerfile @@ -0,0 +1,15 @@ +ARG FEDORA_VERSION + +FROM registry.fedoraproject.org/fedora-toolbox:${FEDORA_VERSION} + +ARG BUILD_NONCE + +ENV TOOLBOX_ENV=base + +LABEL local.voyager.base.nonce=${BUILD_NONCE} + +ADD load-user-bashrc.sh /etc/profile.d/99-load-user-bashrc.sh + +RUN dnf install --assumeyes \ + powerline \ + make diff --git a/load-user-bashrc.sh b/load-user-bashrc.sh new file mode 100644 index 0000000..2cc22cd --- /dev/null +++ b/load-user-bashrc.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# If we are running in a toolbox container that uses an alt home dir, then we +# won't be automatically loading the global user bashrc, which is annoying becasue +# I worked hard to make that bashrc very useful to me. So the below conditional +# checks whether the user bashrc exists (because we can't load it if it isn't there) +# and that the current home dir does not match the user home dir (because if it does +# then we will have already loaded the bashrc when the shell spawned and we'll get +# stuck in a loop) + +if [ -f /var/home/"${USER}"/.bashrc ] && [ "${HOME}" != "/var/home/${USER}" ]; then + HOME=/var/home/"${USER}" source /var/home/"${USER}"/.bashrc; +fi + +if [ -f "${HOME}"/.bashrc ]; then + source "${HOME}/.bashrc"; +fi + +alias dnf='echo "WARNING: Package installs should require a toolbox rebuild, use dnf-local to override"' +alias dnf-local='command dnf'