diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gitconfig | 11 | ||||
-rw-r--r-- | src/init.scm | 6 | ||||
-rw-r--r-- | src/known_hosts.txt | 5 | ||||
-rw-r--r-- | src/profile.sh | 5 | ||||
-rw-r--r-- | src/rc.sh | 79 | ||||
-rw-r--r-- | src/ssh.conf | 6 |
6 files changed, 112 insertions, 0 deletions
diff --git a/src/gitconfig b/src/gitconfig new file mode 100644 index 0000000..f1f1eb3 --- /dev/null +++ b/src/gitconfig @@ -0,0 +1,11 @@ +[init] + defaultBranch = main +[user] + email = ci@$TLD + name = "Git CI" +[advice] + detachedHead = false +[receive] + advertisePushOptions = true +[uploadpack] + allowAnySHA1InWant = true diff --git a/src/init.scm b/src/init.scm new file mode 100644 index 0000000..9e962e8 --- /dev/null +++ b/src/init.scm @@ -0,0 +1,6 @@ +(use-modules + (ice-9 colorized) + (ice-9 readline)) + +(activate-colorized) +(activate-readline) diff --git a/src/known_hosts.txt b/src/known_hosts.txt new file mode 100644 index 0000000..74ba219 --- /dev/null +++ b/src/known_hosts.txt @@ -0,0 +1,5 @@ +# rsync.net public keys +# Verified in 2023-03-08 at: +# https://www.rsync.net/resources/fingerprints.txt + +hk-s020.rsync.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILcPl9x9JfRFwsn09NnDw/xBZbAN80ZQck+h6AqlVqPH diff --git a/src/profile.sh b/src/profile.sh new file mode 100644 index 0000000..1dca8b2 --- /dev/null +++ b/src/profile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# shellcheck source=/dev/null +. /etc/rc +ln -fs .profile .bashrc diff --git a/src/rc.sh b/src/rc.sh new file mode 100644 index 0000000..c79d6d7 --- /dev/null +++ b/src/rc.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +# shellcheck source=/dev/null +. /etc/profile + +export XDG_PREFIX=~/.usr +export XDG_CACHE_HOME="$XDG_PREFIX"/var/cache +export XDG_CONFIG_HOME="$XDG_PREFIX"/etc +export XDG_DATA_HOME="$XDG_PREFIX"/share +export XDG_STATE_HOME="$XDG_PREFIX"/state +export XDG_LOG_HOME="$XDG_PREFIX"/var/log + + +HOME_PARENT="$(dirname "$HOME")" +if [ "$HOME_PARENT" = '/home' ] || [ "$HOME_PARENT" = '/' ]; then + mkdir -p \ + "$XDG_CONFIG_HOME" \ + "$XDG_CACHE_HOME" \ + "$XDG_DATA_HOME" \ + "$XDG_LOG_HOME" \ + "$XDG_STATE_HOME"/ssh/conn +fi + + +GUIX_PROFILE="$XDG_CONFIG_HOME"/guix/current +if [ -r "$GUIX_PROFILE"/etc/profile ]; then + # shellcheck source=/dev/null + . "$GUIX_PROFILE"/etc/profile +fi + +export ENV=~/.profile +export HISTSIZE=-1 +export HISTCONTROL=ignorespace:ignoredups +export EDITOR=vi +export VISUAL="$EDITOR" +export PAGER='less -R' + +export EXINIT=' + " set number + " set autoindent + set ruler + set showmode + set showmatch +' + +export HISTFILE="$XDG_STATE_HOME"/bash-history +export LESSHISTFILE="$XDG_STATE_HOME"/lesshst +export RLWRAP_HOME="$XDG_CACHE_HOME"/rlwrap +export GUILE_HISTORY="$XDG_STATE_HOME"/guile-history + +HOSTNAME="$(hostname)" +export BORG_REPO="$OFFSITE_SSH:borg/$HOSTNAME" +export BORG_REMOTE_PATH='borg1' +export BORG_PASSCOMMAND='cat /opt/secrets/borg-passphrase.txt' + +export GIT_CONFIG_GLOBAL=/etc/gitconfig + +unalias -a +alias l='ls -lahF --color' +alias grep='grep --color=auto' +alias diff='diff --color=auto' +alias watch='watch --color ' +alias man='MANWIDTH=$((COLUMNS > 80 ? 80 : COLUMNS)) man' +alias less='less -R' +alias tree='tree -aC' +alias mv='mv -i' +alias e='vi' + +alias sqlite='rlwrap sqlite3' +alias guile='guile -l /etc/init.scm' + +error_marker() { + STATUS=$? + if [ "$STATUS" != 0 ]; then + printf ' (!! %s !!) ' "$STATUS" + fi +} +export PS1='`error_marker`\T \w/ +\u@\H\$ ' diff --git a/src/ssh.conf b/src/ssh.conf new file mode 100644 index 0000000..ca41df0 --- /dev/null +++ b/src/ssh.conf @@ -0,0 +1,6 @@ +Host * + ServerAliveInterval 30 + ServerAliveCountMax 20 + ControlMaster auto + ControlPath ${XDG_STATE_HOME}/ssh/conn/%r@%h:%p + ControlPersist 1h |