From 3a8ad3022e4e96f2f247bea1c9d82fd446e7ca6c Mon Sep 17 00:00:00 2001 From: Yuri Zamyatin Date: Thu, 10 Apr 2025 22:55:00 +0000 Subject: [PATCH] wip --- arch-user/config/git/config | 4 ++-- .../{user.template.conf => workspace.conf} | 0 arch-user/install.sh | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) rename arch-user/config/{user.template.conf => workspace.conf} (100%) diff --git a/arch-user/config/git/config b/arch-user/config/git/config index d6444aa..4ad2494 100644 --- a/arch-user/config/git/config +++ b/arch-user/config/git/config @@ -1,6 +1,6 @@ [user] - email = yuri@yrz.am - name = Yuri Zamyatin + email = {{ .user.GIT_USER_EMAIL }} + name = {{ .user.GIT_USER_NAME }} [init] defaultBranch = main [pull] diff --git a/arch-user/config/user.template.conf b/arch-user/config/workspace.conf similarity index 100% rename from arch-user/config/user.template.conf rename to arch-user/config/workspace.conf diff --git a/arch-user/install.sh b/arch-user/install.sh index 5345826..67c86c3 100644 --- a/arch-user/install.sh +++ b/arch-user/install.sh @@ -9,6 +9,21 @@ cd "$(dirname "$0")" umask 002 [[ "$(id -u)" == "0" ]] && echo "ERROR: wrong user" >&1 && exit 1 +########## init config ######### +if [[ ! -f ~/.config/workspace.conf ]]; then + mkdir -p ~/.config + cp config/workspace.conf ~/.config +fi +while read -r line; do + param="${line::-1}" + if ! grep -qE "^$param=.+" ~/.config/workspace.conf; then + echo "ERROR: ~/.config/workspace.conf - missing $param" + CONFIG_INVALID=1 + fi +done < config/workspace.conf +[[ $CONFIG_INVALID ]] && exit 1 +################################ + ####### file structure ######### USER_DIRS=( ##### xdg ##### @@ -46,7 +61,8 @@ gomplate --input-dir config \ --exclude-processing "!*.tmpl" \ --plugin jq=/bin/jq \ -c theme=config/theme.json \ - -c user="$HOME/.workspace.conf" + -c user="file:///$HOME/.config/workspace.conf?type=application/x-env" \ + --exclude /workspace.conf ln -sf ~/.config/bash/bashrc ~/.bashrc ln -sf ~/.config/profile ~/.profile