Compare commits

..

6 Commits

5 changed files with 33 additions and 26 deletions

16
.zshrc
View File

@ -68,7 +68,11 @@ export LS_COLORS="su=0:ca=0:*~=0;38;2;102;102;102:mh=0:do=0;38;2;0;0;0;48;2;255;
if command -v eza > /dev/null ; then
alias ls="eza --icons -F -g"
else
alias ls="ls -G"
if [ "$(uname -m)" = "Linux" ] ; then
alias ls="ls --color=auto"
else
alias ls="ls -G"
fi
fi
alias grep='grep --colour=auto'
alias egrep='egrep --colour=auto'
@ -112,4 +116,14 @@ if command -v zoxide > /dev/null ; then
eval "$(zoxide init zsh)"
fi
if [[ "$(uname -r)" =~ "microsoft" ]] ; then
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s) > /dev/null
else
export SSH_AGENT_PID=$(pgrep ssh-agent)
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name "agent.*")
fi
fi
[ -f "$HOME/.zshrc.local" ] && source "$HOME/.zshrc.local"

View File

@ -4,9 +4,6 @@
cd "$(dirname "$0")" || exit 1
shellcheck "$0" || exit 1
shfmt -i 2 -d -s "$0"
has_bin() {
[ -e "$HOME/.nix-profile/bin/$1" ]
}
@ -17,13 +14,15 @@ if ! pgrep nix-daemon >/dev/null 2>&1; then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
# shellcheck disable=SC1091
. /nix/var/nix/profiles/default/etc/profile.d/nix.sh
else
echo "Attempting nix upgrade... may prompt for sudo password"
sudo nix upgrade-nix
fi
PATH="$PATH:$HOME/.nix-profile/bin"
if [ ! -d "/nix/var/nix/profiles/per-user/$(whoami)" ]; then
sudo mkdir "/nix/var/nix/profiles/per-user/$(whoami)"
sudo chown -R "$(whoami)" "/nix/var/nix/profiles/per-user/$(whoami)"
fi
has_bin "cachix" || nix profile install nixpkgs#cachix
if ! has_bin "devenv"; then
cachix use devenv
@ -95,7 +94,6 @@ has_bin "nurl" || nix profile install nixpkgs#nurl
has_bin "nvim" || nix profile install nixpkgs#neovim
has_bin "ouch" || nix profile install nixpkgs#ouch
has_bin "pstree" || nix profile install nixpkgs#pstree
#nix profile install nixpkgs#prettylist
has_bin "q" || nix profile install nixpkgs#q
has_bin "rg" || nix profile install nixpkgs#ripgrep
has_bin "rq" || nix profile install nixpkgs#rq
@ -105,7 +103,6 @@ has_bin "shellcheck" || nix profile install nixpkgs#shellcheck
has_bin "shfmt" || nix profile install nixpkgs#shfmt
has_bin "spacer" || nix profile install nixpkgs#spacer
has_bin "starship" || nix profile install nixpkgs#starship
has_bin "terminal-notifier" || nix profile install nixpkgs#terminal-notifier
has_bin "tig" || nix profile install nixpkgs#tig
has_bin "tldr" || nix profile install nixpkgs#tealdeer
has_bin "tokei" || nix profile install nixpkgs#tokei

View File

@ -4,9 +4,6 @@
cd "$(dirname "$0")" || exit 1
shellcheck "$0" || exit 1
shfmt -i 2 -d -s "$0"
newest_wezterm_release() {
curl -s -H "Accept: application/vnd.github+json" -L https://api.github.com/repos/wez/wezterm/releases/latest | jq -r '.assets | map(select(.name | startswith("WezTerm-macos"))) | first.browser_download_url'
}

View File

@ -1,21 +1,23 @@
_default:
@just --list
# runs checks
checks: _shellcheck _shfmt
_shellcheck:
shellcheck *.sh
_shfmt:
shfmt -i 2 -w -s *.sh
# performs steps for mac
mac:
./install-cli-tools.sh
./setup-shell-config.sh
[ -f "$HOME/.nix-profile/bin/terminal-notifier" ] || nix profile install nixpkgs#terminal-notifier
./setup-shell-configs.sh
./install-mac-apps.sh
# performs steps for linux
linux:
./install-cli-tools.sh
./setup-shell-config.sh
# checks all shell scripts for errors
shellcheck:
shellcheck *.sh
# formats all shell scripts consistently
shfmt:
shfmt -i 2 -w -s *.sh
./setup-shell-configs.sh

View File

@ -4,9 +4,6 @@
cd "$(dirname "$0")" || exit 1
shellcheck "$0" || exit 1
shfmt -i 2 -d -s "$0"
mkdir -p "$HOME/.config"
cat <<EOF >"$HOME/.wezterm.lua"
@ -57,7 +54,7 @@ EOF
mkdir -p "$HOME/.config/helix/themes"
cat <<EOF >"$HOME/.config/helix/config.toml"
theme = "Molokai"
theme = "molokai"
[editor]
true-color = true