commit 92589c8f89f277f7cb8a99d5cc98eb2dc69b0ba9
parent 1ba9421ee04b293aef6445f6ebb3cfcf37b83391
Author: Mark Feller <mfeller@recurly.com>
Date: Wed, 15 Jan 2020 13:17:02 -0700
installer
Signed-off-by: Mark Feller <mfeller@recurly.com>
Diffstat:
3 files changed, 62 insertions(+), 56 deletions(-)
diff --git a/dots/.config/zsh/kubernetes.zsh b/dots/.config/zsh/kubernetes.zsh
@@ -13,7 +13,7 @@ kcc() {
}
authn() {
- istioctl authn -n mjf-istio tls-check $(pod recurly-app-web) | rg "HOST|mjf-istio" --color=never
+ istioctl authn -n qa5 tls-check $(pod recurly-app-web) | rg "HOST|qa5" --color=never
}
# kt() {
diff --git a/install b/install
@@ -1,42 +1,16 @@
#!/bin/sh
#
# Auto installer for macOS packages and dot files
+dotrepo=${dotrepo:-"https://gitlab.com/mark.feller/rice.git"}
+pkgfile=${pkgfile:-"https://gitlab.com/mark.feller/rice/raw/master/pkgs/fedora/packages"}
+logfile=${logfile:-"/var/log/rice.log"}
-log() { printf '\033[1;33m%s \033[m%s\033[m %s\n' "->" "${2:+[1;36m}$1${2:+[m}" "$2" ; }
-
-# Determine which package manager exists on the system
-if [ $(command -v dnf) ]; then
- log "Installing packages for Fedora"
- os=fedora
- installpkg() {
- log "Installing $1..."
- dnf install -y "$1"
- }
-elif [ $(command -v xbps-install) ]; then
- log "Install packages for voidlinux"
- os=void
- installpkg() {
- xbps-install -Sy "$1" >/dev/null 2>&1
- }
-elif [ $(command -v brew) ]; then
- log "Installing packages for macOS"
- os=macos
- installpkg() {
- case $2 in
- C)
- log "Installing $program cask..."
- brew cask install "$1" 2> /dev/null || brew cask upgrade "$1"
- ;;
- *)
- log "Installing $program..."
- brew install "$1" 2> /dev/null || brew upgrade "$1"
- ;;
- esac
- }
-fi
+log() {
+ printf '\033[1;33m%s \033[m%s\033[m %s\n' "->" "${2:+[1;36m}$1${2:+[m}" "$2" \
+ | tee "$logfile"
+}
-dotsrepo=${dotfilesrepo:-"https://gitlab.com/mark.feller/rice.git"}
-pkgfile=${pkgfile:-"https://gitlab.com/mark.feller/rice/raw/master/pkgs/$os/packages"}
+die() { log "$2" && exit 1 ; }
trim_string() {
# Usage: trim_string " example string "
@@ -45,34 +19,61 @@ trim_string() {
printf '%s\n' "$trim"
}
+pre_install() {
+ # Run any preinstall setup necessary
+
+ log "Enabling RPM Fustion"
+ dnf install -y \
+ https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm \
+ https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm \
+ > "$logfile"
+
+ log "Enabled i3-gaps community repo"
+ dnf copr enable gregw/i3desktop > "$logfile"
+
+ log "Enabled alacritty community repo"
+ dnf copr enable pschyska/alacritty > "$logfile"
+}
+
+install_package() {
+ # Install a single package $1 based on its flags $2
+
+ case $2 in
+ G)
+ log "Installing go package $1"
+ go get -u "$1" > "$logfile"
+ ;;
+ *)
+ log "Installing $1..."
+ dnf install -y "$1" > "$logfile"
+ ;;
+ esac
+}
+
install_packages() {
+ # Fetch the package file and install all packages
+
# Copy a real file to our temp pkgfile or attempt to curl the pkgfile
([ -f "$pkgfile" ] && cp "$pkgfile" /tmp/pkgs) || (log "Downloading package list..." && curl -Ls "$pkgfile" > /tmp/pkgs)
packages=$(sed '/^$/d' /tmp/pkgs | sed '/^#/d')
while IFS=' ' read -r flag program comment; do
program=$(trim_string "$program")
- installpkg $program $flag
+ install_package "$program" "$flag"
done <<EOF
$packages
EOF
}
install_dots() {
- git clone "$dotsrepo" ~/.config/rice || log "Dots have already been cloned"
- (cd ~/.config/rice && stow --target=$HOME --ignore='gitignore' dots)
-}
+ # Clone and install dot files
-pre_install() {
- # Enable RPM Fustion free and non-free on Fedora
- [ "$os" == "fedora" ] && {
- log "Enabling RPM Fustion"
- sudo dnf install -y \
- https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
- https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- }
+ log "Fetching dot files"
+ git clone "$dotrepo" ~/.config/rice > "$logfile" || log "Dots have already been cloned"
+ (cd ~/.config/rice && stow --target="$HOME" --ignore='gitignore' dots)
}
+log "Running installer for Fedora"
pre_install
install_packages
install_dots
diff --git a/pkgs/fedora/packages b/pkgs/fedora/packages
@@ -1,28 +1,29 @@
# Tooling
git is a version control system
stow is a tool for managing symlinks for dot files
+ go is the go toolchain
+ rust is the rust toolchain
# Editor
emacs is the best editor
vim is another editor
# Desktop Environment and System Utilities
- compton is an xorg composition manager
i3-gaps is the i3 tilling window manager but with gaps.
xclip allows for copying and pasting from the command line.
- xsetroot sets status bar and other x properties
htop provides system usage information and displays processes
dbus facilities inter-process communication
zsh is a shell that is compatible with bash.
- rust is the rust toolchain
- go is the go toolchain
# File Management
- w3m is a terminal browser which can also view images
- lf is an extensive terminal file manager
- fzf is a fuzzy finder tool
- unrar extracts rars
- unzip unzips zips
+ w3m is a terminal browser which can also view images
+G github.com/gokcehan/lf is an extensive terminal file manager
+ fd-find is a more friendly find
+ ripgrep is a more friendly grep
+ bat prints files out nicely
+ fzf is a fuzzy finder tool
+ unrar extracts rars
+ unzip unzips zips
# Audio and Video
pulseaudio is an audio router
@@ -36,3 +37,6 @@
# Notications
libnotify allows desktop notificatio
dunst is a suckless notification system
+
+# Development tool
+ kubernetes-client is a the kubernetes command line utility+
\ No newline at end of file