]>
Git — Sourcephile - sourcephile-nix.git/blob - hosts/losurdo/encrypt.sh
9 SECRET
=$(mktemp /dev/shm/credential.secret.XXXXXXX)
10 trap 'chmod 600 $SECRET; shred --remove=unlink $SECRET' EXIT
11 gpg
--yes --output "$SECRET" --decrypt "$dir/credential.secret.gpg"
13 gpg
--decrypt "$gpg" |
14 sudo unshare
--mount sh
-xc "
15 mount --bind '$SECRET' /var/lib/systemd/credential.secret &&
16 chmod 400 /var/lib/systemd/credential.secret &&
17 mount --bind '$dir'/machine-id /etc/machine-id &&
18 systemd-creds encrypt --with-key=host --name '${base##*/}' - - |
19 install -m 400 -o '$USER' -g users /dev/stdin '$base.cred'