- Shell 42.8%
- Vim Script 38.1%
- Ruby 19.1%
| debian | ||
| packages | ||
| rpm | ||
| .gitignore | ||
| .gitmodules | ||
| README.md | ||
Setup Environment
Description
Setup packages to setup the environment. Also called dotfiles. This includes bash aliases, packages, documentation, templates, libraries, ... Packages recommends or depends on other packages that allow quick installation of utilities.
This repository produces the following packages:
- base
- bash
- debian
- git
- packaging
- python
- ruby
- vim
A metapackage is also available to install them all at once
- setup (debian)
- setup-all (fedora)
Install
The install process is only possible via packages manager. This allow footprint management on target machines, with each files owned by the package and so easy removal and changes in the file structure.
Debian
Add the repo to /etc/apt/sources.list.d
$ sudo curl https://git.zeromaximum.com/api/packages/yestax/debian/repository.key -o /etc/apt/keyrings/forgejo-yestax.asc
$ echo "deb [signed-by=/etc/apt/keyrings/forgejo-yestax.asc] https://git.zeromaximum.com/api/packages/yestax/debian trixie main" | sudo tee -a /etc/apt/sources.list.d/forgejo.list
$ sudo apt update
Install the package(s)
$ sudo apt install setup
Then on each subsequent release
$ sudo apt update
$ sudo apt upgrade
Fedora
Add the repo to /etc/yum.repos.d
$ sudo dnf config-manager addrepo --from-repofile="https://git.zeromaximum.com/api/packages/yestax/rpm.repo"
$ sudo dnf config-manager --setopt=gitea-yestax.gpgkey=https://git.zeromaximum.com/yestax.gpg --save
$ sudo dnf check-upgrade
Install the package(s)
$ sudo dnf install setup-all
Then on subsequent releases
$ sudo dnf check-upgrade
$ sudo dnf upgrade
See below for some optional steps. Some might be implemented automatically in the future.
Optional steps
Hooks
Packages may provide hooks in /etc/setup/hooks. The purpose is to easily setup plugins (bash, vim, ...) into the user environment. To enable a hook just source it from the rc-file related.
bashrc
if [[ -f /usr/share/setup/hooks/bashrc.hook ]]; then
source /usr/share/setup/hooks/bashrc.hook
fi
profile
if [[ -f /usr/share/setup/hooks/profile.hook ]]; then
source /usr/share/setup/hooks/profile.hook
fi
vimrc
if filereadable(expand('/usr/share/setup/hooks/vimrc.hook'))
source /usr/share/setup/hooks/vimrc.hook
endif
Select an editor
To change the default editor:
- (Debian) select-editor
Run the following to create ~/.selected-editor containing the default editor:
$ select-editor
Minimal but doesn't work with Git commit messages editor. See sensible-editor man page.
- (RECOMMENDED) update-alternatives
Run the following to change the default editor of the alternatives system. Requires sudo privileges.
$ sudo update-alternatives --config editor
Changes the editor symlink in the alternatives system. May be dependent of the distribution. See /etc/alternatives.
- $VISUAL and $EDITOR
It is possible to set the default editor by setting $VISUAL and $EDITOR environment variable.
export VISUAL=vim
export EDITOR="$VISUAL"
These has the highest priority and overrides generally the alternatives sytem. See sensible-editor man page.
Customize PS1 colors
man 7setup ps1