11 Replies
My thoughts on adding configuration for bluefin-cli stuff
the fleek/brew configuration is generated by a go web app that lives at brew.getfleek.dev - this is not necessary at all for ublue, but it provides a reference point for this discussion
GitHub
GitHub - bketelsen/fleekgenbrew
Contribute to bketelsen/fleekgenbrew development by creating an account on GitHub.
the important bits are in a few places
1. definitions of configurations are here in programs.yml
GitHub
fleekgenbrew/bling/programs.yml at main · bketelsen/fleekgenbrew
Contribute to bketelsen/fleekgenbrew development by creating an account on GitHub.
then the init scripts are dynamically generated for each of the configured programs:
GitHub
fleekgenbrew/brew/hook/tmpl/init.sh.tmpl at main · bketelsen/fleekg...
Contribute to bketelsen/fleekgenbrew development by creating an account on GitHub.
when you run the installer, it grabs a tar file that includes a Brewfile, init scripts, and folders for bash and zsh that contain the setup/config for individual programs. They're all concatenated into one file by the template, but we'd want to do that differently.
this is what the generated .bashrc includes. that file lives at ~/.fleek/bash/.bashrc and is sourced by ~/.fleek/init.sh, conditionally based on the shell name
I propose we simplify this , and put these configs in /usr/share/ublue-os/whatever/whatever in bash/ zsh/ fish/ subdirectories, and put smart config files in there.
bash/atuin.sh would look roughly like:
then ujust bluefin-cli would add a stanza in your .bashrc to include/source all the files in /usr/share/ublue-os/whatever/bash/
I've been using this pattern in my dotfiles for bash and zsh (for bash, I added a single line to my ~/.bashrc, https://github.com/ethanjli/dotfiles/blob/master/dot_bashrc#L27, which sources a script at https://github.com/ethanjli/dotfiles/blob/master/dot_config/bash/dot_bashrc#L21, which sources all scripts it finds in https://github.com/ethanjli/dotfiles/tree/master/dot_config/bash/integrations), and it's been really nice to organize these .bashrc/.zshrc snippets as drop-in files in the way you describe.
I think modularizing the snippets in separate files may also help with delivering these .bashrc/.zshrc/etc. customizations via separate sysexts/confexts, if we ever want to decompose bluefin-cli into a few sysexts (e.g. for different bling levels) or to help users extend the initialization with additional sysexts for more bling - in my experiment to deploy the current bluefin-cli container as a sysext, I've noticed that the bluefin-cli container's
/usr/local/bluefin-cli/etc/bashrc
file combines init for starship, fzf, atuin, and zoxide all into the body of one if
statement of one file.beautiful example
just going to star that repo for later
i did a starter video on chezmoi many years ago on Youtube, it's changed a lot since then.
One thing I love about chezmoi is that I can (ab)use
.chezmoiexternal.toml
to download a specified version of bash-preexec for me, as the dotfiles-management substitute for doing https://github.com/ublue-os/toolboxes/blob/0a8f0facb72644e71db5e1ac844189ada1cee269/toolboxes/bluefin-cli/Containerfile.bluefin-cli#L22 in a ContainerfileIm leaning to make sure we have an interactive guard for everything.
I added ugrep which is a drop in replacement for gnu grep. However things like fd and zoxide are not 100% compatible. I believe eza is close enough