Refactor config profiles
This commit is contained in:
parent
08f33e7c48
commit
270ac5b3ec
94
config.toml
94
config.toml
|
@ -14,8 +14,6 @@ longkey = false
|
|||
showdiff = false
|
||||
workdir = "~/.config/dotdrop"
|
||||
|
||||
[dotfiles]
|
||||
|
||||
[dotfiles.d_systemd]
|
||||
dst = "~/.config/systemd/user"
|
||||
src = ".config/systemd/user"
|
||||
|
@ -181,7 +179,7 @@ dst = "~/.config/zsh"
|
|||
src = ".config/fontconfig/fonts.conf"
|
||||
dst = "~/.config/fontconfig/fonts.conf"
|
||||
|
||||
[dotfiles.f_ripgrep_ignore]
|
||||
[dotfiles.f_ignore]
|
||||
src = ".ignore"
|
||||
dst = "~/.ignore"
|
||||
|
||||
|
@ -230,29 +228,43 @@ dst = "~/.config/electron12-flags.conf"
|
|||
src = ".pam_environment"
|
||||
dst = "~/.pam_environment"
|
||||
|
||||
[profiles]
|
||||
[profiles.os_arch]
|
||||
include = ["terminal"]
|
||||
dotfiles = ["f_makepkg.conf", "f_paru.conf"]
|
||||
|
||||
[profiles.base]
|
||||
dotfiles = ["d_systemd"]
|
||||
[profiles.os_arch.variables]
|
||||
os = "arch"
|
||||
|
||||
[profiles.os_ubuntu]
|
||||
include = ["terminal"]
|
||||
|
||||
[profiles.os_ubuntu.variables]
|
||||
os = "ubuntu"
|
||||
|
||||
[profiles.os_termux]
|
||||
include = ["terminal"]
|
||||
|
||||
[profiles.os_termux.variables]
|
||||
os = "termux"
|
||||
|
||||
[profiles.terminal]
|
||||
dotfiles = [
|
||||
"d_nvim_ftplugin",
|
||||
"d_nvim_lua",
|
||||
"d_zsh",
|
||||
"f_alacritty.yml",
|
||||
"f_authorized_keys",
|
||||
"f_gitconfig",
|
||||
"f_hushlogin",
|
||||
"f_ripgrep_ignore",
|
||||
"f_ignore",
|
||||
"f_mailcap",
|
||||
"f_nvim_init",
|
||||
"f_ranger.conf",
|
||||
"f_ranger_commands.py",
|
||||
"f_rtv.cfg",
|
||||
"f_mailcap",
|
||||
"d_zsh",
|
||||
"f_zshrc",
|
||||
"f_tmux.conf",
|
||||
"f_ranger.conf",
|
||||
"f_ssh.conf",
|
||||
"f_authorized_keys",
|
||||
"f_nvim_init",
|
||||
"d_nvim_lua",
|
||||
"d_nvim_ftplugin",
|
||||
"f_gitconfig",
|
||||
"f_alacritty.yml",
|
||||
"f_tmux.conf",
|
||||
"f_zshrc",
|
||||
]
|
||||
|
||||
[profiles.email]
|
||||
|
@ -260,17 +272,17 @@ dotfiles = ["d_neomutt", "d_imapnotify", "f_mbsyncrc", "f_msmtp_config"]
|
|||
|
||||
[profiles.media]
|
||||
dotfiles = [
|
||||
"d_mpv",
|
||||
"f_abcde.conf",
|
||||
"f_beets_config",
|
||||
"f_beets_whitelist",
|
||||
"f_abcde.conf",
|
||||
"d_mpv",
|
||||
"f_youtube-dl_config",
|
||||
"f_mpd.conf",
|
||||
"f_ncmpcpp_bindings",
|
||||
"f_ncmpcpp.conf",
|
||||
"f_libra_config",
|
||||
"f_mpdscribble.conf",
|
||||
"f_mpd.conf",
|
||||
"f_mpdris2.conf",
|
||||
"f_mpdscribble.conf",
|
||||
"f_ncmpcpp.conf",
|
||||
"f_ncmpcpp_bindings",
|
||||
"f_youtube-dl_config",
|
||||
]
|
||||
|
||||
[profiles.sway]
|
||||
|
@ -278,20 +290,15 @@ dotfiles = [
|
|||
"d_sway",
|
||||
"d_waybar",
|
||||
"d_wofi",
|
||||
"f_mako_config",
|
||||
"f_redshift.conf",
|
||||
"d_zathura",
|
||||
"f_mimeo_associations.txt",
|
||||
"f_tdesktop_lang.strings",
|
||||
"f_fonts.conf",
|
||||
"f_zprofile",
|
||||
"f_electron-flags.conf",
|
||||
"f_electron12-flags.conf",
|
||||
"f_fonts.conf",
|
||||
"f_foot.ini",
|
||||
"f_mako_config",
|
||||
"f_redshift.conf",
|
||||
]
|
||||
|
||||
[profiles.pacman]
|
||||
dotfiles = ["f_makepkg.conf", "f_paru.conf"]
|
||||
|
||||
[profiles.gpg]
|
||||
dotfiles = [
|
||||
"f_gpg-agent.conf",
|
||||
|
@ -301,27 +308,30 @@ dotfiles = [
|
|||
]
|
||||
|
||||
[profiles.Mirkwood]
|
||||
include = ["base", "terminal", "email", "media", "sway", "pacman", "gpg"]
|
||||
dotfiles = ["f_paru.conf", "f_gitconfig", "f_foot.ini"]
|
||||
include = ["os_arch", "email", "media", "sway", "gpg"]
|
||||
dotfiles = ["d_systemd"]
|
||||
|
||||
[profiles.Moria]
|
||||
include = ["terminal", "pacman", "media"]
|
||||
include = ["os_arch", "media", "gpg"]
|
||||
dotfiles = ["f_zprofile"]
|
||||
|
||||
[profiles.Gondor]
|
||||
include = ["terminal", "pacman"]
|
||||
include = ["os_arch"]
|
||||
|
||||
[profiles.mko-laptop]
|
||||
include = ["terminal", "media", "gpg"]
|
||||
include = ["os_ubuntu", "media", "gpg"]
|
||||
|
||||
[profiles.Isengard]
|
||||
include = ["os_termux"]
|
||||
|
||||
[profiles.Edoras]
|
||||
include = ["terminal", "pacman"]
|
||||
include = ["os_arch"]
|
||||
|
||||
[profiles.TakamakiPC]
|
||||
include = ["terminal", "pacman"]
|
||||
include = ["os_arch"]
|
||||
|
||||
[profiles.localhost]
|
||||
include = ["terminal"]
|
||||
include = ["os_arch"]
|
||||
|
||||
[profiles.ViiruJaTeippi]
|
||||
include = ["terminal"]
|
||||
|
|
|
@ -12,7 +12,7 @@ forgit_revert_commit=fgrc
|
|||
# Modern replacement for ls
|
||||
alias ls='exa'
|
||||
|
||||
{%@@ if profile != "mko-laptop" @@%}
|
||||
{%@@ if os == "arch" @@%}
|
||||
# Command not found handler
|
||||
# source https://wiki.archlinux.org/title/Zsh#pacman_-F_%22command_not_found%22_handler
|
||||
function command_not_found_handler {
|
||||
|
@ -40,7 +40,6 @@ function command_not_found_handler {
|
|||
done
|
||||
fi
|
||||
}
|
||||
{%@@ endif @@%}
|
||||
|
||||
# search and install/remove packages with fzf
|
||||
pi() {
|
||||
|
@ -59,6 +58,7 @@ pr() {
|
|||
paru -Rns $(echo $SELECTED_PKGS)
|
||||
fi
|
||||
}
|
||||
{%@@ endif @@%}
|
||||
|
||||
# find and open man pages with fzf
|
||||
fman() {
|
||||
|
@ -130,12 +130,7 @@ passync() { pass git pull && pass git push && updatesecrets }
|
|||
|
||||
update() {
|
||||
all() {
|
||||
{%@@ if profile == "Moria" or profile == 'Mirkwood' @@%}
|
||||
paru
|
||||
{%@@ endif @@%}
|
||||
{%@@ if profile == "mko-laptop" @@%}
|
||||
apt-upd
|
||||
{%@@ endif @@%}
|
||||
packages
|
||||
{%@@ if profile == "Moria" @@%}
|
||||
repo
|
||||
docker-update
|
||||
|
@ -143,6 +138,16 @@ update() {
|
|||
plugins
|
||||
}
|
||||
|
||||
packages() {
|
||||
{%@@ if os == "arch" @@%}
|
||||
paru
|
||||
{%@@ elif os == "ubuntu" @@%}
|
||||
sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
|
||||
{%@@ elif os == "termux" @@%}
|
||||
pkg update
|
||||
{%@@ endif @@%}
|
||||
}
|
||||
|
||||
plugins() {
|
||||
nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
|
||||
zinit self-update
|
||||
|
@ -156,26 +161,22 @@ update() {
|
|||
}
|
||||
|
||||
docker-update() {
|
||||
prevpwddocker=$PWD
|
||||
for dir in $HOME/git/dotfiles/docker/*; do
|
||||
cd $dir
|
||||
if [[ -f "DISABLED" ]]; then
|
||||
if [[ -f "$dir/DISABLED" ]]; then
|
||||
echo "$(basename $dir) stack is disabled, skipping..."
|
||||
else
|
||||
dct pull
|
||||
dct up -d
|
||||
dct -f $dir/docker-compose.toml pull
|
||||
dct -f $dir/docker-compose.toml up -d
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
cd $prevpwddocker
|
||||
docker system prune -af --volumes
|
||||
}
|
||||
|
||||
{%@@ endif @@%}
|
||||
{%@@ if profile == "mko-laptop" @@%}
|
||||
apt-upd() {
|
||||
sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
|
||||
}
|
||||
{%@@ endif @@%}
|
||||
|
||||
case "$1" in
|
||||
all)
|
||||
all
|
||||
|
@ -191,19 +192,9 @@ update() {
|
|||
repo
|
||||
;;
|
||||
{%@@ endif @@%}
|
||||
{%@@ if profile == "mko-laptop" @@%}
|
||||
apt)
|
||||
apt-upd
|
||||
;;
|
||||
{%@@ endif @@%}
|
||||
*)
|
||||
{%@@ if profile == "mko-laptop" @@%}
|
||||
apt-upd
|
||||
packages
|
||||
;;
|
||||
{%@@ else @@%}
|
||||
paru
|
||||
;;
|
||||
{%@@ endif @@%}
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue