aboutsummarylogtreecommitdiffstats
path: root/bw-session.service
blob: 103a0306bd6d403295f3e568308944b99fcc2056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[Unit]
Description=unlock Bitwarden vault
After=bw-login.service
Requires=bw-login.service

[Service]
Type=oneshot
RemainAfterExit=yes
LoadCredentialEncrypted=bw-password
Environment=PASSWORD_STORE_DIR="%S/bw-systemd"
ExecStart=-/usr/bin/notify-send 'Unlocking BitWarden vault'
# double-encrypted password allows e.g. Yubikey touch, and avoids plaintext in %d
ExecStart=/usr/bin/sh -c 'bw unlock --raw --passwordfile=<(gpg --decrypt "%d/bw-password") | pass insert -mf session-key'
ExecStop=/usr/bin/bw lock

[Install]
WantedBy=default.target