1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
#+title: dotfiles management
#+PROPERTY: header-args :mkdirp yes
#+auto_tangle: t
* git
#+begin_src conf :tangle ~/.gitconfig
[user]
name = cashmere
email = cashmere@autistici.org
useConfigOnly = true
signingkey = B877C0AC3B080FBB!
[init]
defaultBranch = master
[commit]
gpgsign = true
[gpg]
format = openpgp
program = gpg
[pull]
rebase = true
[push]
autoSetupRemote = true
default = current
[fetch]
prune = true
pruneTags = true
[diff]
algorithm = histogram
[merge]
conflictstyle = zdiff3
[alias]
dft = -c diff.external=difft diff
dlog = -c diff.external=difft log -p --ext-diff
dshow = -c diff.external=difft show --ext-diff
[rebase]
autosquash = true
autostash = true
[core]
autocrlf = input
[remote "origin"]
gcrypt-participants = B877C0AC3B080FBB
gcrypt-signingkey = B877C0AC3B080FBB
[wt]
basedir = .git/wt
copyignored = true
copymodified = true
#+end_src
* .env
#+begin_src sh :tangle ~/.env
# Common environment for login shells and X session
EDITOR=vi
PAGER=less
export EDITOR PAGER
PASSWORD_STORE_DIR=$HOME/pass
export PASSWORD_STORE_DIR
# Launch gpg-agent and expose its SSH socket
gpgconf --launch gpg-agent
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
#+end_src
* .profile
#+begin_src sh :tangle ~/.profile
#
# .profile - POSIX Shell startup script for login shells
#
# see also sh(1), environ(7).
#
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
# Let sh(1) know it's at home, despite /home being a symlink.
if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi
# Query terminal size; useful for serial lines.
if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
# Display a random cookie on each login.
if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi
# Shared environment (GPG, editor, password-store)
. "$HOME/.env"
# Start xonsh for interactive login shells on a tty
if [ -n "$PS1" ] && [ -x /usr/local/bin/xonsh ]; then
exec /usr/local/bin/xonsh
fi
#+end_src
* .xinitrc
#+begin_src sh :tangle ~/.xinitrc
. "$HOME/.env"
export GPG_TTY=$(tty)
exec i3
#+end_src
* .xonshrc
#+begin_src python :tangle ~/.xonshrc
import subprocess, shutil
$GPG_TTY = $(tty).strip()
subprocess.run(["gpg-connect-agent", "updatestartuptty", "/bye"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if shutil.which("atuin"):
running = subprocess.run(["pgrep", "-x", "atuin"], capture_output=True).returncode == 0
if not running:
subprocess.Popen(["atuin", "daemon", "start"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True)
execx($(atuin init xonsh))
execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')
#+end_src
* atuin
#+begin_src toml :tangle ~/.config/atuin/config.toml
auto_sync = true
sync_address = "https://atuin.cashmere.rs"
sync_frequency = "1m"
[daemon]
enabled = true
systemd_socket = false
[dotfiles]
enabled = true
#+end_src
* ssh
** =authorized_keys=
#+begin_src conf :tangle ~/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILOwBidfdZzcSEIPSRT0C8U9U55WSES1ugqAKE+nvgQ9 (none)
#+end_src
* gpg setup
** TODO gpg-agent.conf
** TODO sshcontrol
* Tasks
** Services
*** TODO [#C] Unlock disk encryption over SSH
*** Navidrome
*** yggdrasil
|