commit 5c8f9c6fab4e380464fbd5b716926d13b9420b97
parent 24068d92335667e4e750e5fdfd6c3e06da829e2c
Author: oscarbenedito <oscar@obenedito.org>
Date: Tue, 21 Jan 2020 12:35:34 +0100
Updated chezmoi's configuration and added ssh config
Diffstat:
5 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl
@@ -1,19 +1,14 @@
-{{ $pgpkey := promptString "Is there a PGP key set up" -}}
-{{ $website := promptString "Is the website repository under ~/Git/obenedito.org" -}}
-{{ $backups := promptString "Set up backups" -}}
-{{ $loc := promptString "Chezmoi executable location" -}}
+{{ $computer := promptString "Which computer do you want to set up" -}}
[data]
- pgpkey = {{ $pgpkey }}
- website = {{ $website }}
- chezmoi_location = "{{ $loc }}"
-{{- if eq $backups "true" }}
-{{- $backup_exclude := promptString "backup_exclude" }}
-{{- $small_backup_exclude := promptString "small_backup_exclude" }}
-{{- $backup_dir := promptString "backup_dir" }}
+ computer = "{{ $computer }}"
+ pgpkey = {{ eq $computer "gray" }}
+ website = {{ eq $computer "gray" }}
+ chezmoi_location = "{{ if eq $computer "gray" }}/bin/chezmoi{{ end }}"
+{{- if eq $computer "gray" }}
[data.backup]
- backup_exclude = {{ $backup_exclude }}
- small_backup_exclude = {{ $small_backup_exclude}}
- backup_dir = "{{ $backup_dir }}"
+ backup_exclude = ["/.*"]
+ small_backup_exclude = ["/USB", "/Git/backup"]
+ backup_dir = "BACKUP_GRAY"
{{- else }}
backup = false
{{- end }}
diff --git a/.chezmoiignore b/.chezmoiignore
@@ -5,6 +5,10 @@ markion.py
*.md
.scripts/*.md
.*/*/*.md
+.scripts/deploy-website.sh
{{ if not .website -}}
-.scripts
+.scripts/tmux-website.sh
+{{- end }}
+{{ if not (eq .computer "white") -}}
+.config/i3
{{- end }}
diff --git a/dot_bash_aliases.tmpl.md b/dot_bash_aliases.tmpl.md
@@ -18,7 +18,7 @@ alias clear="printf '\033c'"
Alias to update the system, diferent for Debian or Arch.
``` file dot_bash_aliases.tmpl
-{{ if ne .chezmoi.hostname "fme-desktop" -}}
+{{ if ne .computer "cfis" -}}
alias upgrade="
{{- if eq .chezmoi.osRelease.id "debian" -}}
sudo apt-get update && sudo apt-get upgrade
@@ -30,7 +30,7 @@ alias upgrade="
Alias to run VSCode on computer where I can't install programs
``` file dot_bash_aliases.tmpl
-{{- if eq .chezmoi.hostname "fme-desktop" -}}
+{{- if eq .computer "cfis" -}}
alias vscode="$HOME/KOLMOGOROV/VSCode-linux-x64/bin/code"
{{- end }}
```
@@ -38,14 +38,14 @@ alias vscode="$HOME/KOLMOGOROV/VSCode-linux-x64/bin/code"
## Backups
If backup is enabled in the `chezmoi` data, create backup alias, excluding the files specified in the `chezmoi` data. First is the complete backup alias:
``` block backup_all
-alias backup_all="rsync -loptruzvP --delete --exclude={
+alias backup_all="rsync -loptruzvP --delete --exclude={{ if gt (len .backup.backup_exclude) 1 -}} { {{- end }}
{{- range $i, $dir := .backup.backup_exclude }}
{{- if $i -}}
,
{{- end -}}
"{{ $dir }}"
{{- end -}}
-} {{ .chezmoi.homedir }}/ /media/$USER/OSCAR/.{{ .backup.backup_dir }}/"
+{{ if gt (len .backup.backup_exclude) 1 -}} } {{- end }} {{ .chezmoi.homedir }}/ /media/$USER/OSCAR/.{{ .backup.backup_dir }}/"
```
And secondly the smaller backup, with extra excluded directories. I back it up on a USB drive so I encrypted with VeraCrypt (as I carry my USB around, I wouldn't want my personal data to be in plain text in case I lost it). It will back it up to two VeraCrypt volumes (as the backup takes up more than 4GiB and the USB where I do it is formated with a FAT filesystem). First of all, we mount the VeraCrypt volumes:
@@ -112,9 +112,13 @@ If website is enabled in the `chezmoi` configuration, we create aliases to the s
``` file dot_bash_aliases.tmpl
{{- if .website }}
alias website="~/.scripts/tmux-website.sh"
-alias deploy_website="~/.scripts/deploy-website.sh"
{{- end }}
```
+I used to have the following alias for deploying the website. It is not needed anymore
+```
+alias deploy_website="~/.scripts/deploy-website.sh"
+```
+
## License
This file is licensed under the CC0 1.0 Universal license and therefore is part of the public domain. To the extent possible under law, Oscar Benedito, who associated CC0 with this work, has waived all copyright and related or neighboring rights to this work. You can find a copy of the CC0 license [here](https://gitlab.com/oscarbenedito/dotfiles/blob/master/CC0-1.0).
diff --git a/dot_gitconfig.tmpl.md b/dot_gitconfig.tmpl.md
@@ -15,7 +15,7 @@ signingkey = 827E5A8E3AE8A499
{{- end }}
```
-If a PGP is used, we'll add the following line to sign commits by default.
+If a PGP key is used, we'll add the following line to sign commits by default.
```toml file dot_gitconfig.tmpl
{{- if .pgpkey }}
[commit]
diff --git a/private_dot_ssh/config b/private_dot_ssh/config
@@ -0,0 +1,15 @@
+Host blue
+ HostName obenedito.org
+ User root
+
+Host cims
+ HostName cims-cellex.cat
+ User cims
+
+Host cangur
+ HostName inscripcions.cangur.org
+ User cangur
+
+Host cims-antic
+ HostName antic.cims-cellex.cat
+ User cims