Skip to content

Commit

Permalink
adds linux
Browse files Browse the repository at this point in the history
  • Loading branch information
lestex committed Jan 22, 2024
1 parent 69ff4f0 commit c9ddbe0
Show file tree
Hide file tree
Showing 6 changed files with 286 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .config/code/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"workbench.colorTheme": "Default Dark+",
"git.confirmSync": false,
"window.zoomLevel": 0.9,
"terminal.integrated.fontFamily": "Liga SFMono Nerd Font"
"terminal.integrated.fontFamily": "JetBrainsMono Nerd Font"
}
117 changes: 117 additions & 0 deletions .config/zsh/.zshrc-linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
brew
terraform
kubectl
zsh-autosuggestions
zsh-syntax-highlighting
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias kcb="kind create cluster --name basic --config $HOME/.config/kind/cluster-basic.yaml"

# recommended by brew doctor
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"

# pyenv settings
eval "$(pyenv init -)"

eval "$(starship init zsh)"

# check the platform
PLATFORM=$(uname -n)

# Completion for zsh
source "/usr/share/google-cloud-sdk/completion.zsh.inc"
20 changes: 20 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: linux ci

on:
pull_request:
branches:
- '*'
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Run script
run: make all
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ all: $(OS) ## check the OS

linux: ## run linux specific tasks
@echo "on linux"
./linux-setup

macos: ## run macos specific tasks
@echo "on mac"
Expand Down
147 changes: 147 additions & 0 deletions linux-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#!/usr/bin/env bash

# Exit on any individual command failure.
set -e

TERRAFORM_VERSION=1.5.0
PYTHON_VERSION=3.11.4

# Pretty colors.
red='\033[0;31m'
green='\033[0;32m'
neutral='\033[0m'

# Shared functions
pretty_print() {
printf "\n%b\n" "$1"
}

pretty_print "${green}Starting ...${neutral}"

sudo apt update -y

# install zsh
if ! command -v zsh &>/dev/null;
then
pretty_print "Installing ZSH"
sudo apt install zsh -y
else
pretty_print "You already have ZSH installed...good job!"
fi

# Oh my zsh installation
if [ ! -d "$HOME/.oh-my-zsh" ]; then
pretty_print "Installing oh-my-zsh..."
curl -L http://install.ohmyz.sh | sh
else
pretty_print "oh-my-zsh is already installed, skipping ..."
fi

# Oh my zsh zsh-autosuggestions
if [ ! -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ]; then
pretty_print "Installing zsh-autosuggestions..."
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
else
pretty_print "zsh-autosuggestions is already installed, skipping ..."
fi

if [ ! -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ]; then
pretty_print "Installing zsh-syntax-highlighting..."
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
else
pretty_print "zsh-syntax-highlighting is already installed, skipping ..."
fi

# install software
sudo apt install -y curl jq htop btop tree vim neovim vifm tmux gpg mpv wget apt-transport-https ca-certificates gnupg


# install rust
curl https://sh.rustup.rs -sSf | bash -s -- -y

# install pyenv
if [ ! -d "$HOME/.pyenv" ]; then
pretty_print "Installing pyenv..."
curl https://pyenv.run | bash
else
pretty_print "pyenv is already installed, skipping ..."
fi

# install starship
cargo install starship --locked

# install brave browser
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
sudo apt install brave-browser

# install vscode
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update

# brew "awscli"
# brew "packer"
# brew "tfenv"
# brew "go"
# brew "node"
# brew "helm"
# brew "watch"
# brew "kind"
# brew "podman"
# brew "kubectx"
# brew "krew"
# brew "k9s"

# Installing vscode extensions
for ext in $(cat install/Codefile)
do
pretty_print "Installing vscode extension: $ext"
code --install-extension $ext --force
done

# # Install terraform
# tfenv install $TERRAFORM_VERSION
# tfenv use $TERRAFORM_VERSION

# pretty_print "Copying configs to .configs directory"
mkdir -p ~/.config
cp -R .config/* ~/.config

# pretty_print "Installing fonts"
cp -r fonts/*.otf $HOME/.local/share/fonts
cp -r fonts/*.ttf $HOME/.local/share/fonts
fc-cache -f -v

# pretty_print "Changing zshrc config"
cp .config/zsh/.zshrc-linux $HOME/.zshrc

# pretty_print "Configuring vscode"
cp .config/code/settings.json $HOME/.config/Code/User/settings.json

# if [ ! -d $HOME/.config/vifm/colors ];
# then
# mkdir -p ~/.config/vifm/colors
# git clone https://github.com/vifm/vifm-colors ~/.config/vifm/colors
# fi

# # Install tmux plugin manager
if [ ! -d $HOME/.config/tmux/plugins ];
then
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
fi

# # Install python if not installed
# [ ! -d $HOME/.pyenv/versions/$PYTHON_VERSION ] && pyenv install $PYTHON_VERSION

# pretty_print "${green}We are done!...everything looks good!${neutral}"

# install google cloud sdk
if [ ! -f "/usr/share/keyrings/cloud.google.gpg" ]; then
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
fi
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get update && sudo apt-get install google-cloud-cli
Empty file added test
Empty file.

0 comments on commit c9ddbe0

Please sign in to comment.