Compare commits

...

3 Commits

Author SHA1 Message Date
inkch
00c0f93591 add [age] settings to toml 2024-01-18 11:58:21 +09:00
inkch
8e1c359245 add run_ script to decrypt age key 2024-01-18 11:57:35 +09:00
inkch
d993e9f25f add age key for encryption 2024-01-18 11:56:42 +09:00
4 changed files with 22 additions and 0 deletions

View File

@ -8,6 +8,10 @@
command = "nvim" command = "nvim"
args = ["-d", "{{ `{{ .Destination }}` }}", "{{ `{{ .Source }}` }}", "{{ `{{ .Target }}` }}"] args = ["-d", "{{ `{{ .Destination }}` }}", "{{ `{{ .Source }}` }}", "{{ `{{ .Target }}` }}"]
[age]
identity = "~/.config/chezmoi/key.txt"
recipient = "age1j75kdg9enpwlvnmxv3qak90gn5swlez63f580wzj6ucw37xemy3s0knqa6" # can be array
{{- $choices := list "desktop" "laptop" "server" }} {{- $choices := list "desktop" "laptop" "server" }}
{{ $hosttype := promptChoiceOnce . "hosttype" "What type of host" $choices }} {{ $hosttype := promptChoiceOnce . "hosttype" "What type of host" $choices }}
[data] [data]

View File

@ -2,6 +2,7 @@
# https://www.chezmoi.io/reference/special-files-and-directories/chezmoiignore/ # https://www.chezmoi.io/reference/special-files-and-directories/chezmoiignore/
README.md README.md
key.txt.age
.bashrc .bashrc
{{- if ne .chezmoi.osRelease.id "arch" }} {{- if ne .chezmoi.osRelease.id "arch" }}

10
key.txt.age Normal file
View File

@ -0,0 +1,10 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNjcnlwdCBYUktsZFNMd1RKY0wxaC9M
M01WTUVRIDE4CnFoeFQyODFtZzZGQ3IvSkM2bENtVHdUdGpPVmRJRU5mRytzM2lj
Rzc1U28KLS0tIEFPcTMyY1ZqK3FXMlZOczZhL3VaUHFzOWtxaU5QSFNhZ25TejJp
WCtrTHcKZIO64yEvnkbmnnViQZNM6b2NZeynphRxSUwiuDae0J52fUeVp1cDpAoi
yEytIo7+7/UW8sKzwQsaSdC01veGK2Ks4a9j7UlUloc+e5bE4qcf2oJLylNnpsht
4e7eZV+9Q62Ph3K+NJQQY3vPYP3iruXHtG4aqp+Ua77tRTewniGzjDkDQu160PPc
fnU6XI4VydgKLr++MXvUU90iFYlvTp0lN1KkkqrJpZ2UboA6MUsXOW9hUAt9aeWG
oiJvl+7mKe965XXvxPgOniPlUEHAZWWYLX5xmu3AUwrYq1k=
-----END AGE ENCRYPTED FILE-----

View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ ! -f "${HOME}/.config/chezmoi/key.txt" ]; then
mkdir -p "${HOME}/.config/chezmoi"
chezmoi age decrypt --output "${HOME}/.config/chezmoi/key.txt" --passphrase "{{ .chezmoi.sourceDir }}/key.txt.age"
chmod 600 "${HOME}/.config/chezmoi/key.txt"
fi