docs: dotfiles as a subsection

This commit is contained in:
Michel 2024-05-06 13:57:05 +02:00
parent a778997fdf
commit 0fca37b41a
1 changed files with 75 additions and 75 deletions

View File

@ -1,82 +1,12 @@
<!-- markdownlint-disable line-length no-inline-html no-duplicate-heading -->
# Bare Git Repository
- <https://www.atlassian.com/git/tutorials/dotfiles>
- StreakyCobra
## Starting from scratch
```sh
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
```
## Install onto a new system
The `checkout` command is expected to fail with a message.
This is because your $HOME folder might already have some stock configuration
files which would be overwritten by Git.
The “BKDIR” part is a rough shortcut to move all the offending files
automatically to a backup folder:
```sh
git clone --bare <git-repo-url> $HOME/.dotfiles
export ALL_PROXY=127.0.0.1:8082
git clone --bare https://forge.chapril.org/michel_ouba/points.git $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
BRANCH=opt
BKDIR=".dotfiles-backup/";
dotfiles checkout ${BRANCH} 2>&1 | egrep "\s+" | awk {'print $1'} |
xargs -I{} sh -c "mkdir -p \$(dirname ${BKDIR}{}); mv -iv {} ${BKDIR}{}";
dotfiles checkout ${BRANCH}
```
When the `fetch` configuration is not set, insert the following line in the
_remote_ section of `.dotfiles/config`:
```config
fetch = +refs/heads/*:refs/remotes/origin/*
```
## Install into `/etc/skel`
```sh
sudo mkdir -p /etc/skel/.dotfiles
sudo chown $(whoami) /etc/skel
git clone --bare $(dotfiles remote -v | head -1 | cut -f2 | cut -f1 -d' ') /etc/skel/.dotfiles
alias skelfiles='/usr/bin/git --git-dir=/etc/skel/.dotfiles --work-tree=/etc/skel'
skelfiles config --local status.showUntrackedFiles no
skelfiles checkout
```
## Useful Commands
- List all tracked files (from CWD):
`dotfiles ls-tree --name-only -rz main | xargs -0 $(whence lsd) -lU`
## Other Tools
```sh
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
```
# Every-day Tools
# Installation Tips
Recommended installation order:
- System Config
- [System Config](#syscfg)
- [Debian packages](#debian)
- [Qubes proxy scripts](#qubes)
- dotfiles (see above)
- [dotfiles](#dotfiles)
- [ASDF](#asdf) & plugins
- [Newer Debian packages](#versions_check)
- [Fonts](#fonts)
@ -84,7 +14,7 @@ Recommended installation order:
- [lazygit](#lazygit)
- [nnn](#nnn)
- [neovim](#neovim)
- Install into `/etc/skel` (see above)
- Install into `/etc/skel` (see dotfiles)
## Generic Tips
@ -118,7 +48,7 @@ git apply --stat --apply 2604.patch
- check _Limit outgoing connections_;
- check _Allow full access for 25 minutes_.
## System Config
## System Config {#syscfg}
- [SysRq](https://www.kicksecure.com/wiki/SysRq)
@ -149,6 +79,76 @@ chmod +x $HOME/bin/*-proxy
TODO: Insert random part in filenames.
## dotfiles — Bare Git Repository {#dotfiles}
- <https://www.atlassian.com/git/tutorials/dotfiles>
- StreakyCobra
### Starting from scratch
```sh
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
```
### Install onto a new system
The `checkout` command is expected to fail with a message.
This is because your $HOME folder might already have some stock configuration
files which would be overwritten by Git.
The “BKDIR” part is a rough shortcut to move all the offending files
automatically to a backup folder:
```sh
git clone --bare <git-repo-url> $HOME/.dotfiles
export ALL_PROXY=127.0.0.1:8082
git clone --bare https://forge.chapril.org/michel_ouba/points.git $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
BRANCH=main
BKDIR=".dotfiles-backup/";
dotfiles checkout ${BRANCH} 2>&1 | egrep "\s+" | awk {'print $1'} |
xargs -I{} sh -c "mkdir -p \$(dirname ${BKDIR}{}); mv -iv {} ${BKDIR}{}";
dotfiles checkout ${BRANCH}
```
When the `fetch` configuration is not set, insert the following line in the
_remote_ section of `.dotfiles/config`:
```config
fetch = +refs/heads/*:refs/remotes/origin/*
```
### Install into `/etc/skel`
```sh
sudo mkdir -p /etc/skel/.dotfiles
sudo chown $(whoami) /etc/skel
git clone --bare $(dotfiles remote -v | head -1 | cut -f2 | cut -f1 -d' ') /etc/skel/.dotfiles
alias skelfiles='/usr/bin/git --git-dir=/etc/skel/.dotfiles --work-tree=/etc/skel'
skelfiles config --local status.showUntrackedFiles no
skelfiles checkout
```
### Useful Commands
- List all tracked files (from CWD):
`dotfiles ls-tree --name-only -rz main | xargs -0 $(whence lsd) -lU`
### Other Tools
```sh
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
```
## ASDF & main plugins {#asdf}
`.zshrc` will install `asdf`.