From 748e5bb561fbb7eb622b175207783d6d73f7ec69 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 25 Sep 2023 11:51:23 +0300 Subject: [PATCH] feat(dotbot): plugins: pipx, snap and crontab --- .gitignore | 1 + .gitmodules | 9 +++++++++ add-submodules.sh | 21 +++++++++++++++++---- config/exports-apps | 1 + install | 12 +++++++++--- install.conf.yaml | 16 ++++++++++++++++ scripts/install-cargo-packages.sh | 8 ++++++-- scripts/install-pip-packages.sh | 2 +- tools/dotbot-crontab | 1 + tools/dotbot-pip | 1 + tools/dotbot-snap | 1 + tools/requirements-pipx.txt | 2 ++ 12 files changed, 65 insertions(+), 10 deletions(-) create mode 160000 tools/dotbot-crontab create mode 160000 tools/dotbot-pip create mode 160000 tools/dotbot-snap create mode 100644 tools/requirements-pipx.txt diff --git a/.gitignore b/.gitignore index aaa1b99..92b66f6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ ssh/local.d/* !ssh/local.d/.gitkeep !.gitkeep .env +local/share/fonts/NerdFonts diff --git a/.gitmodules b/.gitmodules index 76edffc..6b04cab 100644 --- a/.gitmodules +++ b/.gitmodules @@ -47,3 +47,12 @@ [submodule "tmux/tmux-window-name"] path = config/tmux/plugins/tmux-window-name url = https://github.com/ofirgall/tmux-window-name.git +[submodule "dotbot-crontab"] + path = tools/dotbot-crontab + url = https://github.com/codekansas/dotbot-crontab.git +[submodule "dotbot-snap"] + path = tools/dotbot-snap + url = https://github.com/DrDynamic/dotbot-snap.git +[submodule "dotbot-pip"] + path = tools/dotbot-pip + url = https://github.com/sobolevn/dotbot-pip.git diff --git a/add-submodules.sh b/add-submodules.sh index ec324a7..c7a2418 100755 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -1,9 +1,22 @@ #!/usr/bin/env bash -git submodule add --name dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot -git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew -git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include -git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community +# dotbot and plugins +git submodule add --name dotbot \ + -f https://github.com/anishathalye/dotbot.git tools/dotbot +git submodule add --name dotbot-brew \ + -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew +git submodule add --name dotbot-include \ + -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include +git submodule add --name dotbot-crontab \ + -f https://github.com/codekansas/dotbot-crontab.git tools/dotbot-crontab +git submodule add --name dotbot-snap \ + -f https://github.com/DrDynamic/dotbot-snap.git tools/dotbot-snap +git submodule add --name dotbot-pip \ + -f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip + +# other repos +git submodule add --name cheat-community \ + -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community # tmux plugin manager and plugins git submodule add --name tmux/tpm \ diff --git a/config/exports-apps b/config/exports-apps index 0afc448..acae445 100755 --- a/config/exports-apps +++ b/config/exports-apps @@ -119,6 +119,7 @@ have gem && path_append "$(gem environment gemdir)/bin" have rbenv && eval "$(rbenv init - zsh)" # Rust / cargo +export RUSTUP_HOME="$XDG_DATA_HOME/rustup" export CARGO_HOME="$XDG_DATA_HOME/cargo" path_append "$CARGO_HOME/bin" diff --git a/install b/install index 3f389c0..387af40 100755 --- a/install +++ b/install @@ -18,18 +18,24 @@ git submodule update --init --recursive "${DOTBOT_DIR}" -d "${BASEDIR}" \ --plugin-dir=tools/dotbot-brew \ --plugin-dir=tools/dotbot-include \ + --plugin-dir=tools/dotbot-crontab \ + --plugin-dir=tools/dotbot-snap \ + --plugin-dir=tools/dotbot-pip \ -c "${CONFIG}" \ "${@}" if [ "${DOTBOT_HOST}" != "" ]; then DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}" echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}" - [ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \ - && echo "(!) Found $DOTBOT_HOST_CONFIG" \ - && "$DOTBOT_BIN_PATH" \ + [ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] && + echo "(!) Found $DOTBOT_HOST_CONFIG" && + "$DOTBOT_BIN_PATH" \ -d "$BASEDIR" \ --plugin-dir=tools/dotbot-brew \ --plugin-dir=tools/dotbot-include \ + --plugin-dir=tools/dotbot-crontab \ + --plugin-dir=tools/dotbot-snap \ + --plugin-dir=tools/dotbot-pip \ -c "$DOTBOT_HOST_CONFIG" \ "${@}" fi diff --git a/install.conf.yaml b/install.conf.yaml index 45d2f93..c126156 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -52,3 +52,19 @@ - shell: - git submodule update --init --recursive --force - bash local/bin/dfm install all +- pipx: + file: tools/requirements-pipx.txt + stdout: false + stderr: true +- crontab: + - time: 0 5 * * * + command: brew update && brew upgrade + platform: darwin # Optional + - time: 0 5 * * * + command: apt update && apt upgrade + platform: linux # Optional + - time: 0 5 * * * + command: task sync +- snap: + - nvim: + classic: true diff --git a/scripts/install-cargo-packages.sh b/scripts/install-cargo-packages.sh index 25c43d4..1b9897c 100755 --- a/scripts/install-cargo-packages.sh +++ b/scripts/install-cargo-packages.sh @@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh" ! have cargo && { msg "cargo could not be found. installing cargo with rustup.rs" - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path } packages=( @@ -18,6 +18,9 @@ packages=( "eza" # A simple, fast and user-friendly alternative to 'find' "fd-find" + "cargo-update" + "pijul" + "ripgrep" ) for pkg in "${packages[@]}"; do @@ -26,7 +29,8 @@ for pkg in "${packages[@]}"; do # Skip comments if [[ ${pkg:0:1} == "#" ]]; then continue; fi - cargo install $pkg + msg "Installing cargo package $pkg" + cargo install "$pkg" echo "" done diff --git a/scripts/install-pip-packages.sh b/scripts/install-pip-packages.sh index c4d23de..b7e95e7 100755 --- a/scripts/install-pip-packages.sh +++ b/scripts/install-pip-packages.sh @@ -18,7 +18,7 @@ for pkg in "${packages[@]}"; do # Skip comments if [[ ${pkg:0:1} == "#" ]]; then continue; fi - python3 -m pip install --user $pkg + python3 -m pip install --user "$pkg" echo "" done diff --git a/tools/dotbot-crontab b/tools/dotbot-crontab new file mode 160000 index 0000000..ea900a7 --- /dev/null +++ b/tools/dotbot-crontab @@ -0,0 +1 @@ +Subproject commit ea900a7cf66add3c56dc5e9d4f426af8b05b9ac0 diff --git a/tools/dotbot-pip b/tools/dotbot-pip new file mode 160000 index 0000000..42e6a8f --- /dev/null +++ b/tools/dotbot-pip @@ -0,0 +1 @@ +Subproject commit 42e6a8f3bed4a34e307d1119986a029218a51f27 diff --git a/tools/dotbot-snap b/tools/dotbot-snap new file mode 160000 index 0000000..5722c4e --- /dev/null +++ b/tools/dotbot-snap @@ -0,0 +1 @@ +Subproject commit 5722c4e5afaa56cdccc9e5be628a69d3f17b815f diff --git a/tools/requirements-pipx.txt b/tools/requirements-pipx.txt new file mode 100644 index 0000000..5d4de6e --- /dev/null +++ b/tools/requirements-pipx.txt @@ -0,0 +1,2 @@ +openapi-python-client +libtmux