-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from ublue-os/m2giles-bluefin-cli
feat: brew state via bind mount
- Loading branch information
Showing
16 changed files
with
170 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ LABEL com.github.containers.toolbox="true" \ | |
maintainer="[email protected]" | ||
|
||
COPY ./toolboxes/bluefin-cli/packages.bluefin-cli /toolbox-packages | ||
COPY ./toolboxes/bluefin-cli/files/etc /etc | ||
COPY ./toolboxes/bluefin-cli/files / | ||
|
||
# Update image, Install Packages, and move /home/linuxbrew | ||
RUN apk update && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# /etc/bashrc | ||
|
||
# System wide functions and aliases | ||
# Environment stuff goes in /etc/profile | ||
|
||
# It's NOT a good idea to change this file unless you know what you | ||
# are doing. It's much better to create a custom.sh shell script in | ||
# /etc/profile.d/ to make custom changes to your environment, as this | ||
# will prevent the need for merging in future updates. | ||
|
||
# Prevent doublesourcing | ||
if [ -z "$PROFILESOURCED" ] && [ "$PS1" ]; then | ||
PROFILESOURCED="Y" | ||
fi | ||
|
||
if [ -z "$BASHRCSOURCED" ]; then | ||
BASHRCSOURCED="Y" | ||
|
||
# are we an interactive shell? | ||
if [ "$PS1" ]; then | ||
if [ -z "$PROMPT_COMMAND" ]; then | ||
case $TERM in | ||
xterm*) | ||
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' | ||
;; | ||
screen*) | ||
PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' | ||
;; | ||
*) | ||
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default | ||
;; | ||
esac | ||
fi | ||
# Turn on parallel history | ||
shopt -s histappend | ||
# Turn on checkwinsize | ||
shopt -s checkwinsize | ||
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " | ||
# You might want to have e.g. tty in prompt (e.g. more virtual machines) | ||
# and console windows | ||
# If you want to do so, just add e.g. | ||
# if [ "$PS1" ]; then | ||
# PS1="[\u@\h:\l \W]\\$ " | ||
# fi | ||
# to your custom modification shell script in /etc/profile.d/ directory | ||
fi | ||
STARSHIP_CONFIG=/etc/starship.toml | ||
export STARSHIP_CONFIG | ||
eval "$(starship init $SHELL)" | ||
fi | ||
|
||
|
||
# vim:ts=4:sw=4 | ||
|
36 changes: 36 additions & 0 deletions
36
toolboxes/bluefin-cli/files/etc/profile.d/00-bluefin-cli-brew-firstrun.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
if test "$(id -u)" -gt "0"; then | ||
green=$'\033[32m' | ||
bold=$'\033[1m' | ||
normal=$'\033[0m' | ||
if test ! -f /etc/linuxbrew.firstrun; then | ||
printf "\nBluefin-CLI First Run Setup\n\n" | ||
printf "Setting up sudo for ${bold}${USER}${normal}...\t\t\t " | ||
echo "#${UID} ALL = (root) NOPASSWD:ALL" | su-exec root tee -a /etc/sudoers > /dev/null | ||
printf "${green}[ OK ]${normal}\n" | ||
fi | ||
|
||
if test ! -d /home/linuxbrew/.linuxbrew && test ! -d /usr/local/share/bash-completion; then | ||
printf "Setting up Linuxbrew...\t\t\t\t " | ||
if test ! -d "${XDG_DATA_HOME:-$HOME/.local/share}"/bluefin-cli; then | ||
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}"/bluefin-cli | ||
fi | ||
if test ! -d /home/linuxbrew; then | ||
su-exec root mkdir -p /home/linuxbrew | ||
fi | ||
if test ! -d /home/linuxbrew/.linuxbrew; then | ||
su-exec root mount --bind "${XDG_DATA_HOME:-$HOME/.local/share}"/bluefin-cli /home/linuxbrew | ||
su-exec root cp -R /home/homebrew/.linuxbrew /home/linuxbrew/ | ||
su-exec root chown -R $UID /home/linuxbrew | ||
fi | ||
printf "${green}[ OK ]${normal}\n" | ||
su-exec root mkdir -p /usr/local/share/bash-completion | ||
if test ! -d /usr/loca/share/bash-completion/completions; then | ||
su-exec root mount --bind /run/host/usr/share/bash-completion /usr/local/share/bash-completion | ||
fi | ||
fi | ||
|
||
if test ! -f /etc/linuxbrew.firstrun; then | ||
su-exec root touch /etc/linuxbrew.firstrun | ||
printf "\nBluefin-CLI first run complete!\n\n" | ||
fi | ||
fi |
20 changes: 20 additions & 0 deletions
20
toolboxes/bluefin-cli/files/etc/profile.d/bash_completion.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# shellcheck shell=sh disable=SC1091,SC2039,SC2166 | ||
# Check for interactive bash and that we haven't already been sourced. | ||
if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then | ||
|
||
# Check for recent enough version of bash. | ||
if [ "${BASH_VERSINFO[0]}" -gt 4 ] || | ||
[ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 2 ]; then | ||
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && | ||
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" | ||
if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then | ||
# Source completion code. | ||
. /usr/share/bash-completion/bash_completion | ||
fi | ||
if shopt -q progcomp && [ -r /usr/local/share/bash-completion/bash_completion ]; then | ||
# Source completion code. | ||
. /usr/local/share/bash-completion/bash_completion | ||
fi | ||
fi | ||
|
||
fi |
14 changes: 0 additions & 14 deletions
14
toolboxes/bluefin-cli/files/etc/profile.d/bluefin-cli-brew-firstrun.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# LS Colors via Eza | ||
alias ll='eza -l --icons=auto --group-directories-first' 2>/dev/null | ||
alias l.='eza -d .*' 2>/dev/null | ||
alias ls='eza' 2>/dev/null | ||
alias l1='eza -1' | ||
|
||
# Grep Colors | ||
alias grep='grep --color=auto' 2>/dev/null | ||
alias egrep='grep -E --color=auto' 2>/dev/null | ||
alias fgrep='grep -F --color=auto' 2>/dev/null | ||
alias xzgrep='xzgrep --color=auto' 2>/dev/null | ||
alias xzegrep='xzegrep --color=auto' 2>/dev/null | ||
alias xzfgrep='xzfgrep --color=auto' 2>/dev/null |
13 changes: 13 additions & 0 deletions
13
toolboxes/bluefin-cli/files/etc/profile.d/command-not-found-host-exec.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
command_not_found_handle() { | ||
# don't run if not in a container | ||
if [ ! -e /run/.containerenv ] && [ ! -e /.dockerenv ]; then | ||
exit 127 | ||
fi | ||
|
||
distrobox-host-exec "${@}" | ||
} | ||
if [ -n "${ZSH_VERSION-}" ]; then | ||
command_not_found_handler() { | ||
command_not_found_handle "$@" | ||
} | ||
fi |
3 changes: 3 additions & 0 deletions
3
toolboxes/bluefin-cli/files/etc/profile.d/zz-profile_sourced.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if [ -z "$PROFILESOURCED" ] && [ "$PS1" ]; then | ||
PROFILESOURCED="Y" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[character] | ||
success_symbol = '[\$](bold green dimmed)' | ||
error_symbol = '[\$](bold red)' | ||
|
||
[container] | ||
symbol='📦' | ||
format='[$symbol](bold green dimmed) ' | ||
|
||
[directory] | ||
style = 'bold cyan dimmed' | ||
|
||
[hostname] | ||
ssh_only = false | ||
style = 'green bold dimmed' | ||
format = '[$ssh_symbol$hostname]($style) ' | ||
|
||
[username] | ||
style_user = 'green bold dimmed' | ||
style_root = 'red bold' | ||
format = '[$user]($style)@' | ||
show_always = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if [ -f ~/.bashrc ]; then | ||
. ~/.bashrc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if [ -f /etc/bashrc ]; then | ||
. /etc/bashrc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
brew | ||
command-not-found | ||
cosign | ||
eza | ||
git | ||
|