ENH remove weird systemd mount thingies

This commit is contained in:
Nathan Dwarshuis 2021-03-20 14:55:27 -04:00
parent 6bf4ff0d7d
commit 7c5104b52f
8 changed files with 3 additions and 60 deletions

View File

@ -5,26 +5,7 @@
bin="$1"
shift
## TODO most of this stuff could be more easily done in the rofi-extras
## haskell code where many of the edge cases that this is hoping to avoid are
## already strictly/brutally snuffed out by GHC's iron fist
alias="gnupg"
notify_error () {
notify-send --icon=dialog-error-symbolic "$1"
}
notify_info () {
notify-send --icon=dialog-information-symbolic "$1"
}
if ! systemctl --user is-active --quiet mount-veracrypt@gnupg.service; then
if systemctl --user --quiet start mount-veracrypt@gnupg.service; then
notify_info "Mounted $GNUPGHOME"
"$bin" "$@"
else
notify_error "Could not mount gnupg directory"
exit 1
fi
else
"$bin" "$@"
fi
rofi-dev -c "$XDG_CONFIG_HOME/rofi/devices.yml" -m "$alias" \
&& "$bin" "$@" || echo "Could not mount $alias"

View File

@ -1,8 +1,6 @@
[Unit]
Description=Mailbox synchronization service
After=network.target network-online.target dbus.socket mount-veracrypt@gnupg.service
# we need gpg keys which are stored in a Veracrypt volume
Requires=mount-veracrypt@gnupg.service
[Service]
Type=oneshot

View File

@ -1,7 +0,0 @@
[Unit]
Description=Mount sshfs directory for %i
[Service]
Type=forking
ExecStart=/usr/bin/sshfs ${TARGET} ${MOUNTPOINT}
ExecStop=/usr/bin/fusermount -u ${MOUNTPOINT}

View File

@ -1,7 +0,0 @@
[Unit]
Requires=mount-veracrypt@ssh.service
After=mount-veracrypt@ssh.service
[Service]
Environment="TARGET=portnoy4prez:/mnt/data/home/Music"
Environment="MOUNTPOINT=/mnt/data/Music"

View File

@ -1,7 +0,0 @@
[Unit]
Requires=mount-veracrypt@ssh.service
After=mount-veracrypt@ssh.service
[Service]
Environment="TARGET=portnoy4prez:/mnt/data/home/Videos"
Environment="MOUNTPOINT=/mnt/data/Videos"

View File

@ -1,7 +0,0 @@
[Unit]
Description=Mount veracrypt volume for %i
[Service]
Type=forking
ExecStart=%h/.bin/mount.veracrypt ${BW_NAME} ${VOLUME} ${MOUNTPOINT}
ExecStop=%h/.bin/umount.veracrypt ${MOUNTPOINT}

View File

@ -1,4 +0,0 @@
[Service]
Environment="BW_NAME=Veracrypt (gpg)"
Environment="VOLUME=/mnt/data/Documents/crypt/gnupg"
Environment="MOUNTPOINT=$GNUPGHOME"

View File

@ -1,4 +0,0 @@
[Service]
Environment="BW_NAME=Veracrypt (ssh)"
Environment="VOLUME=/mnt/data/Documents/crypt/ssh-config"
Environment="MOUNTPOINT=%h/.ssh"