diff --git a/home/.config/home-manager/home.nix b/home/.config/home-manager/home.nix index f772a605..02bf1938 100644 --- a/home/.config/home-manager/home.nix +++ b/home/.config/home-manager/home.nix @@ -148,6 +148,14 @@ irb-power_assert ''; + # - Tiny tools by me, they may be rewritten with another language. + # - Keep *.bash in shellscript naming in this repo for maintainability, the extname should be trimmed in the symlinks + xdg.dataFile."homemade/bin/bench_shells".source = ../../../home/.local/share/homemade/bin/bench_shells.bash; + xdg.dataFile."homemade/bin/updeps".source = ../../../home/.local/share/homemade/bin/updeps.bash; + home.sessionPath = [ + "${config.xdg.dataHome}/homemade/bin" + ]; + home.packages = [ pkgs.dprint pkgs.deno @@ -221,3 +229,5 @@ ]; } + + diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc index f269049e..f97ee28e 100644 --- a/home/.config/zsh/.zshrc +++ b/home/.config/zsh/.zshrc @@ -71,40 +71,6 @@ _compinit_with_interval() { } _compinit_with_interval -update_tools() { - case ${OSTYPE} in - linux*) - sudo apt update --yes && sudo apt upgrade --yes - ;; - darwin*) - softwareupdate --install --recommended - ;; - esac - - nix-channel --update - home-manager switch - - if type 'sheldon' > /dev/null; then - sheldon lock --update - fi - if command -v rtx; then - rtx self-update - rtx plugins update - fi -} - -# Keep under 120ms...! -bench_zsh() { - hyperfine 'zsh -i -c exit' -} - -bench_shells() { - bench_zsh - # Really having same options as zsh...? - hyperfine 'bash -i -c exit' - hyperfine 'nu -i -c exit' -} - case ${OSTYPE} in darwin*) test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" diff --git a/home/.local/share/homemade/bin/bench_shells.bash b/home/.local/share/homemade/bin/bench_shells.bash new file mode 100755 index 00000000..a7b72270 --- /dev/null +++ b/home/.local/share/homemade/bin/bench_shells.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# ~ my feeling ~ +# 50ms : blazing fast! +# 120ms : acceptable +# 200ms : 1980s? +# 300ms : slow! + +hyperfine 'zsh -i -c exit' +# Really having same options as zsh...? +hyperfine 'bash -i -c exit' +hyperfine 'nu -i -c exit' diff --git a/home/.local/share/homemade/bin/updeps.bash b/home/.local/share/homemade/bin/updeps.bash new file mode 100755 index 00000000..2f5aff15 --- /dev/null +++ b/home/.local/share/homemade/bin/updeps.bash @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +case ${OSTYPE} in +linux*) + sudo apt update --yes && sudo apt upgrade --yes + ;; +darwin*) + softwareupdate --install --recommended + ;; +esac + +nix-channel --update +home-manager switch + +if type 'sheldon' >/dev/null; then + sheldon lock --update +fi +if command -v rtx; then + rtx self-update + rtx plugins update +fi