Dotfiles handled with chezmoi.
Go to file
2024-01-26 12:56:23 +01:00
bin Added bash script to check if a remote port is reachable. 2023-03-02 10:53:00 +01:00
dot_bashrc.d Added alias to print raspberry pi temperature. 2024-01-26 12:56:23 +01:00
dot_local/share/bash-completion/completions Added bash completion for chezmoi. 2022-03-13 10:49:56 +01:00
dot_talisman/bin Adjusted talisman script to use talisman executable (expected in PATH). 2023-01-18 11:42:13 +01:00
dot_vim/indent vim: added groovy indent script. 2022-11-09 19:18:15 +01:00
private_dot_config Removed interactive flag from talisman pre-commit hook script. 2023-01-18 12:55:20 +00:00
.chezmoi.toml.tmpl Changed PS1 creation to a more flexible solution. 2021-02-13 10:38:22 +01:00
.chezmoiignore Minor changes. 2022-05-11 08:22:34 +02:00
dot_bashrc_linux Added extension include. 2020-10-23 13:29:58 +02:00
dot_gitconfig.tmpl Added global pre-commit git hook. 2023-01-16 14:38:09 +01:00
dot_vimrc Minor changes in gitconfig and vimrc. 2022-05-12 08:13:35 +02:00
README.adoc Added 'completion' hint to README.adoc. 2023-01-23 14:53:41 +01:00
vim-lightline.tar.gz Added vim ligthline plugin. 2020-11-08 16:56:24 +01:00

Dotfiles managed with chezmoi

For syntax of template rules see also:

Initialization

TODO: how to handle a new linux system correctly.

Test with centos7-01:

  1. put executable to HOME dir

  2. add public ssh key to gitea user

  3. initialize with ./chezmoi init sdroid@gitea.sdroid.uber.space:heavy/dotfiles.git

  4. check what will happen with ./chezmoi diff

  5. apply it with ./chezmoi apply

After that a bin directory will exist (if not yet present before), move the executable to this dir to have it PATH.

add to .bashrc
# If not running interactively, don't do anything
# see https://stackoverflow.com/questions/12440287/scp-doesnt-work-when-echo-in-bashrc
[[ "$-" != *i* ]] && return

if [ -x ~/.bashrc.d/bashrc.init ]; then
    . ~/.bashrc.d/bashrc.init
fi

AWS Systeme (Draft)

TODO: create user file for initialization at provisioning

Caution
Debian AWS systems use a motd initialization causing problems. The user is logged out immediatly after a SSH login. Remove x flag from 11.motd to avoid this.
  1. install go sudo yum install -y golang golang-bin

  2. install git sudo yum install -y git-all

  3. install chezmoi from git repo (see below)

  4. check GOPATH and adjust if necessary

  5. initialize with chezmoi init https://gitea.sdroid.uber.space/heavy/dotfiles.git (Use 'heavy' as user).

  6. check what will happen with chezmoi diff

  7. TODO: vi .config/chezmoi/chezmoi.toml (Template is not correct)

  8. apply it with chezmoi apply

chezmoi installation
cd $(mktemp -d)
git clone --depth=1 https://github.com/twpayne/chezmoi.git
cd chezmoi
go install

New User

Better try modifications with a new user to keep the defaul user accessible to the system. See below links to proceed.

Uberspace

Alternative way to include .sshrc by detecting SSH connection.

# User specific aliases and functions

# test if the prompt var is not set
# See https://unix.stackexchange.com/questions/154395/running-scp-when-bashrc-of-remote-machine-includes-source-command
if [ -z "$PS1" ]; then
    # prompt var is not set, so this is *not* an interactive shell
    return
fi

if [ -f ~/.sshrc ] && [ -z "$SSH_CLIENT" ]; then
    echo "Not a ssh connection"
else
    echo "ssh client is present: $SSH_CLIENT"
    . ~/.sshrc
fi

cygwin

When using cygwin, the chezmoi executable has defaults for Windows. That means the default HOME dir is the Windows %USERPROFILE% directory. To provide the managed files to the cygwin path /home/user the target directory has to be adjusted while calling chezmoi.

H:\>chezmoi apply -D C:\cygwin64\home\user

H:\>chezmoi -D C:\cygwin64\home\user managed
C:\cygwin64\home\user\.gitconfig
C:\cygwin64\home\user\.solarize_colors
C:\cygwin64\home\user\.solarize_colors_base
C:\cygwin64\home\user\.sshrc
C:\cygwin64\home\user\.vimrc
C:\cygwin64\home\user\bin

Content

.local/share/bash-completion/completions

Contains bash completion scripts. At least in Debian, this will be sourced. See also https://opensource.com/article/18/3/creating-bash-completion-script