~mkelly/config

d59de618182ee86de37a8cc007d49004301919c6 — Michael Kelly 7 months ago 6ae11fe
[cleanup] No `packages` op, simpler filenames

I never used the `packages` op anyway, and it lets us call the other ops
simpler names!
5 files changed, 33 insertions(+), 54 deletions(-)

M deploy.sh
R deploy.ignorefiles => ignorefiles
D initial_install_packages
D notes
A setup-notes.md
M deploy.sh => deploy.sh +12 -28
@@ 29,16 29,16 @@
#
# Tested with dash 0.5.11.
#
# Sun 09 Jul 2023 01:50:33 AM EDT
# Thu Jul 13 12:10:10 AM EDT 2023
# -----------------------------------------------------------------

# File used to mark directories we should recurse into.
MAGIC_OVERLAY_FILE='overlay-directory'

# Where we look for names of files to skip
IGNOREFILES="ignorefiles"
# Timestamp for this run
TIMESTAMP="$(date +%Y%m%d-%H%M%S)"

PACKAGE_FILE="initial_install_packages"

# -----------------------------------------------------------------

# Deploys all the files in the given directory. Tries to skip this script and


@@ 55,7 55,7 @@ deploy_dir () {
  ls -a $path | while read base_f; do
    f="$path/$base_f"
    # We don't copy a specific list of files.
    if grep -q -- "^$base_f\$" "$CONF_DIR/deploy.ignorefiles"; then
    if grep -q -- "^$base_f\$" "$CONF_DIR/$IGNOREFILES"; then
      echo "# SKIP: $f"
      continue
    fi


@@ 110,46 110,30 @@ maybe_mv () {
  fi
}

install_packages () {
  local package_list=$1
  local packages="$(grep -E -v '^\s*#' $package_list)"
  local cmd="sudo apt-get"
  if [ "$MODE" != "real" ]; then
    cmd="echo Would run: $cmd"
  fi
  $cmd install -y $packages
}

# -----------------------------------------------------------------

ACTION=$1
CONF_DIR="$PWD"

if [ "$ACTION" = "config" ]; then
if [ "$ACTION" = "deploy" ]; then
  TARGET_DIR="$HOME"
  MODE="real"
  deploy_dir "$TARGET_DIR" "$CONF_DIR"
elif [ "$ACTION" = "test-config" ]; then
elif [ "$ACTION" = "test" ]; then
  TARGET_DIR="$HOME/test"
  echo
  echo "*** Test-run mode. Deploying to ${TARGET_DIR}. ***"
  echo
  MODE="real"
  deploy_dir "$TARGET_DIR" "$CONF_DIR"
elif [ "$ACTION" = "dry-config" ]; then
elif [ "$ACTION" = "dryrun" ]; then
  echo
  echo "*** Dry-run mode. Run '$0 config' to run for real. ***"
  echo
  TARGET_DIR="$HOME"
  MODE="test"
  deploy_dir "$TARGET_DIR" "$CONF_DIR"
elif [ "$ACTION" = "dry-packages" ]; then
  echo
  echo "*** Dry-run mode. Run '$0 packages' to run for real. ***"
  echo
  MODE="test"
  install_packages "$CONF_DIR/$PACKAGE_FILE"
elif [ "$ACTION" = "packages" ]; then
  MODE="real"
  install_packages "$CONF_DIR/$PACKAGE_FILE"
else
  echo "USAGE: $0 test-config|config|dry-config|packages|dry-packages"
  echo "USAGE: $0 dryrun|test|deploy"
  exit 2
fi

R deploy.ignorefiles => ignorefiles +1 -2
@@ 1,9 1,8 @@
.build.yml
deploy.ignorefiles
ignorefiles
deploy.sh
.git
.gitignore
initial_install_packages
LICENSE.txt
README.md
overlay-directory

D initial_install_packages => initial_install_packages +0 -10
@@ 1,10 0,0 @@
# Packages to install.
# These packages require X, and so are commented out by default:
#qiv
# Some extra stuff:
#cifs-utils
#aptitude
git
gnupg
tmux
vim

D notes => notes +0 -14
@@ 1,14 0,0 @@
# This file contains notes about the contents of other files I should set up.
# It is in an adhoc format I am making up right now:
# Lines beginning with '#' are comments
# Lines beginning with '-' designate filenames
# Lines beginning with ' ' are the contents for the most-recently-specified file.

-/etc/fstab
 # samba stuff, for easy mounting of shares
 \\caravel.home.michaelkelly.org\share   /mnt/share   cifs credentials=/home/mkelly/.share-creds
 \\caravel.home.michaelkelly.org\share2  /mnt/share2  cifs credentials=/home/mkelly/.share-creds

 # or, NFS
 caravel.home.michaelkelly.org:/data/share   /mnt/share   nfs4 noauto,timeo=14,soft,user 0 0
 caravel.home.michaelkelly.org:/data2        /mnt/share2  nfs4 noauto,timeo=14,soft,user 0 0

A setup-notes.md => setup-notes.md +20 -0
@@ 0,0 1,20 @@
# Setup Notes

## Packages
Base setup:
git
gnupg
tmux
vim
neovim

GUI machine with Sway:
lxqt-policykit
network-manager-applet
dunst
light
waybar
fontawesome5-fonts
grimshot
rofi
blueman