From cbd75a2b62476b3289a1d1ef4693328d09bf3e6f Mon Sep 17 00:00:00 2001 From: fkrebs Date: Wed, 20 May 2026 21:42:08 +0200 Subject: [PATCH] fix: properly-quoted install.sh + bashrc --- README.md | 12 ++++++++++++ home/.bashrc | 20 ++++++++++++++++++++ home/.gitconfig | 19 +++++++++++++++++++ install.sh | 11 +++++++++++ 4 files changed, 62 insertions(+) create mode 100644 README.md create mode 100644 home/.bashrc create mode 100644 home/.gitconfig create mode 100755 install.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..de6cfe4 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# dotfiles + +Personal dotfiles for Coder workspaces. Coder clones this repo and runs install.sh +on workspace start (configured via the workspace template parameter dotfiles_uri). + +## Layout +- install.sh — idempotent symlink installer; runs every workspace start +- home/ — contents mirrored into $HOME (preserving relative paths) + +## Add to a workspace +When creating a workspace in Coder, set the optional dotfiles_uri to: +`https://git.nuclide.systems/fkrebs/dotfiles.git` diff --git a/home/.bashrc b/home/.bashrc new file mode 100644 index 0000000..3c20873 --- /dev/null +++ b/home/.bashrc @@ -0,0 +1,20 @@ +# minimal sourced by login shells in Coder workspaces +export PATH="$HOME/.local/bin:$PATH" +export EDITOR="${EDITOR:-nano}" +export MPLBACKEND="${MPLBACKEND:-Agg}" + +alias ll='ls -lah --color=auto' +alias g='git' +alias gs='git status -sb' +alias gd='git diff' +alias gco='git checkout' +alias uvr='uv run' +alias uvs='uv sync' + +mkproj() { + local name="$1" + [ -z "$name" ] && echo 'usage: mkproj ' && return 1 + mkdir -p "$HOME/work/$name" && cd "$HOME/work/$name" && uv init +} + +PS1='\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ ' diff --git a/home/.gitconfig b/home/.gitconfig new file mode 100644 index 0000000..7665166 --- /dev/null +++ b/home/.gitconfig @@ -0,0 +1,19 @@ +[user] + name = fkrebs + email = fkrebs@nucli.de +[init] + defaultBranch = main +[pull] + rebase = true +[push] + default = simple + autoSetupRemote = true +[core] + editor = nano +[diff] + algorithm = histogram +[alias] + s = status -sb + co = checkout + br = branch + lg = log --oneline --graph --decorate -20 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..65c470c --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Idempotent install — symlinks files from this repo into $HOME. +set -euo pipefail +SRC=$(cd "$(dirname "$0")" && pwd) +mkdir -p ~/.config +while IFS= read -r f; do + rel=${f#"$SRC/home/"} + mkdir -p "$HOME/$(dirname "$rel")" + ln -sf "$SRC/home/$rel" "$HOME/$rel" +done < <(find "$SRC/home" -mindepth 1 -type f) +echo "dotfiles linked from $SRC/home"