Skip to content

Commit

Permalink
Add JuNest
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlf committed May 17, 2024
1 parent 286ad48 commit 06e936d
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 58 deletions.
15 changes: 2 additions & 13 deletions my-home/dot-exports
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export TIMEFORMAT=$'\nreal %3R\tuser %3U\tsys %3S\tpcpu %P\n'
[ -f /usr/share/X11/locale/en_US.UTF-8 ] && export LC_ALL="en_US.UTF-8"
export PROMPT_COMMAND='history -a'
export TERM=xterm # this is to fix some annoying things with screen
export NCARG_ROOT=/usr/local/ncl-6.3.0
export PATH=$NCARG_ROOT/bin:$PATH
export EDITOR='lvim'
export VISUAL='vim'
export dockerclean='docker image prune -a --filter "until=12h"'
Expand All @@ -19,15 +17,6 @@ if [[ "$unamestr" == 'Darwin' ]]; then
export CLICOLOR=1
fi

# set PATH so it includes user's private bin if it exists
if [ -d $HOME/bin ] ; then
export PATH="$HOME/bin:$PATH"
if [ -d $HOME/bin/lib ] ; then
export LD_LIBRARY_PATH="$HOME/bin/lib/:$LD_LIBRARY_PATH"
fi
fi

export PATH="$PATH:$HOME/.local/bin:$HOME/.npm-global/bin"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
path+=($HOME/.local/bin $HOME/.npm-global/bin $HOME/.local/share/junest/bin $HOME/.junest/usr/bin_wrappers $HOME/.rvm/bin $path)
export PATH
export ROS_DOMAIN_ID="3"
92 changes: 50 additions & 42 deletions scripts/nas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,73 @@
SYSTEM="NAS"
DOTFILES_DIR=$(pwd)

source "$DOTFILES_DIR/scripts/utils.sh"

print_details
set -e

function stow(){
for f in $1/*; do
link="$2/$(echo $(basename $f) | sed -r 's/dot-/./')"
unlink $link
ln -sf $f $link
done
function pac_update(){
yes | sudoj pacman -Syu

return 0
}

# redefine symlinks to use the nas stow
function sym_links(){
mkdir -p $HOME/.config
stow $DOTFILES_DIR/my-home $HOME/
stow $DOTFILES_DIR/private/.ssh $HOME/.ssh
stow $DOTFILES_DIR/config $HOME/.config
}
function pac_install(){
yes | sudoj pacman -S --needed $@

sudo busybox --install /opt/bin/
return 0
}

sudo opkg install \
autoconf \
findutils \
gawk \
gcc \
git \
git-http \
go \
grep \
htop \
make \
neovim \
python3 \
python3-pip \
rename \
tmux \
tree \
vim-full \
zsh
source "$DOTFILES_DIR/scripts/utils.sh"

# the /tmp on my nas only has 64mb of space
mkdir -p /share/Public/tmp
sudo mount /share/Public/tmp /tmp
print_details

git submodule init
git submodule update

INFO "Installing busybox"
sudo busybox --install /opt/bin/

INFO "Installing JuNest"
[[ ! -d $HOME/.local/share/junest ]] && git clone https://github.com/fsquillace/junest.git $HOME/.local/share/junest
[[ ! -d $HOME/.junest ]] && junest setup
pac_update

INFO "Installing stow"
pac_install \
stow

sym_links

zsh_extras
INFO "Installing zsh"
sudo opkg install \
zsh

INFO "Installing base system"
pac_install \
btop \
fzf \
iftop \
python \
python-pip \
tmux

fzf_install
zsh_extras

starship_install

INFO "Installing neovim"
pac_install \
chafa \
git-lfs \
go \
neovim \
nodejs \
npm \
python-gitpython \
python-pynvim \
python-ply \
python-virtualenv \
python-yaml \
rust

lunarvim_install

sudo umount /share/Public/tmp && sudo rm -rf /share/Public/tmp
INFO "FInished setting up system"
39 changes: 36 additions & 3 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,49 @@ KERNEL_RELEASE=$(uname -r)
KERNEL_VERSION=$(uname -v)
NODE=$(uname -n)

BWHITE='\033[1;37m'
GREEN='\033[0;32m'
ORANGE='\033[0;33'
RED='\033[0;31m'
RESET='\033[0m'

function LOG(){
printf "$@${RESET}\n"
}

function INFO(){
LOG ${GREEN}$@
}

function WARN(){
LOG ${ORANGE}$@
}

function ERROR(){
LOG ${RED}$@
}

# print the current system details
# this expects DOTFILES_DIR and SYSTEM to be defined
function print_details(){
echo \
LOG ${BWHITE} \
"
SYSTEM: $SYSTEM
OS: $OS
KERNEL: $KERNEL
KERNEL_RELEASE: $KERNEL_RELEASE
KERNEL_VERSION: $KERNEL_VERSION
NODE: $NODE
USER: $(whoami)
HOME: $HOME
DOTFILES_DIR: $DOTFILES_DIR
"
}

# function to create my links
# This expects the variable $DOTFILES_DIR to exist
function sym_links(){
INFO "Creating symlinks"
mkdir -p $HOME/.config
stow -v --dotfiles --adopt --dir $DOTFILES_DIR --target $HOME --restow my-home
stow -v --adopt --dir $DOTFILES_DIR/private/ --target $HOME/.ssh --restow .ssh
Expand Down Expand Up @@ -78,7 +103,7 @@ function snap_install(){
}

function sudo_rule(){
echo "$USER ALL = NOPASSWD: $@" | sudo tee -a /etc/sudoers
INFO "$USER ALL = NOPASSWD: $@" | sudo tee -a /etc/sudoers

return 0
}
Expand Down Expand Up @@ -108,11 +133,18 @@ function lazygit_install(){

# install lunarvim
function lunarvim_install(){
INFO "Installing LunarVIM"
mkdir -p $HOME/.config/pip
echo \
"[global]
break-system-packages = true" > $HOME/.config/pip/pip.conf

curl -sSL https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh | LV_BRANCH='release-1.3/neovim-0.9' bash -s -- -y
}

# setup starship
function starship_install(){
INFO "Installing starship"
curl -sS https://starship.rs/install.sh -o starship.sh
chmod +x starship.sh
./starship.sh -y --bin-dir $HOME/.local/bin
Expand All @@ -121,6 +153,7 @@ function starship_install(){

# install the various zsh components
function zsh_extras(){
INFO "Setting up zsh extras"
# install zgenom
[ ! -d $HOME/.zgenom ] && git clone https://github.com/jandamm/zgenom.git ${HOME}/.zgenom

Expand All @@ -130,5 +163,5 @@ function zsh_extras(){
# install fonts
mkdir -p $HOME/.local/bin
curl -fsSL https://raw.githubusercontent.com/getnf/getnf/main/install.sh | bash
$HOME/.local/bin/getnf -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono
$HOME/.local/bin/getnf -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono | true # don't fail on fonts
}

0 comments on commit 06e936d

Please sign in to comment.