diff --git a/snowblocks/systemd/README.md b/snowblocks/systemd/README.md new file mode 100644 index 0000000..25a641b --- /dev/null +++ b/snowblocks/systemd/README.md @@ -0,0 +1,32 @@ +* [Units](#units) + * [Services](#services) + * [igloosync-dropbox](#igloosync-dropbox) + +# Units + +## Services + +### igloosync-dropbox + +> The [gocryptfs][gocryptfs-gh] password **must be stored in the** [GNOME Keyring][archwiki-keyring] **before enabling this user service** in order to receive the value from the [`secret-tool`][gnome-libsecret]! + +The stored password must be assigned with the following attribute-value pair: + +* attribute: `igloosync` +* value: `dropbox` + +To store the password run + +```sh +secret-tool store --label="igloosync-dropbox" igloosync dropbox +``` + +The password can be received from the `secret-tool` by running + +```sh +secret-tool lookup igloosync dropbox +``` + +[archwiki-keyring]: https://wiki.archlinux.org/index.php/GNOME/Keyring +[gnome-libsecret]: https://wiki.gnome.org/Projects/Libsecret +[gocryptfs-gh]: https://github.com/rfjakob/gocryptfs diff --git a/snowblocks/systemd/snowblock.json b/snowblocks/systemd/snowblock.json new file mode 100644 index 0000000..3aef248 --- /dev/null +++ b/snowblocks/systemd/snowblock.json @@ -0,0 +1,20 @@ +[ + { + "clean": ["~/.config/systemd/user"] + }, + { + "link": { + "~/.config/systemd/user/igloosync-dropbox.service": { + "create": true, + "hosts": { + "archbook": "units/user/igloosync-dropbox.service", + "igloo": "units/user/igloosync-dropbox.service" + } + }, + "~/.config/systemd/user/ssh-agent.service": { + "create": true, + "path": "units/user/ssh-agent.service" + } + } + } +] diff --git a/snowblocks/systemd/units/user/igloosync-dropbox.service b/snowblocks/systemd/units/user/igloosync-dropbox.service new file mode 100644 index 0000000..1b3a7ba --- /dev/null +++ b/snowblocks/systemd/units/user/igloosync-dropbox.service @@ -0,0 +1,12 @@ +[Unit] +Description=Dropbox Synchronization (igloosync-dropbox) +After=network.target local-fs.target + +[Service] +Type=forking +ExecStart=/usr/bin/gocryptfs -allow_other -extpass="secret-tool lookup igloosync dropbox" %h/cloud/.dropbox/Dropbox/sync %h/cloud/dropbox +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=default.target diff --git a/snowblocks/systemd/units/user/ssh-agent.service b/snowblocks/systemd/units/user/ssh-agent.service new file mode 100644 index 0000000..161b15a --- /dev/null +++ b/snowblocks/systemd/units/user/ssh-agent.service @@ -0,0 +1,10 @@ +[Unit] +Description=SSH Key Agent + +[Service] +Type=forking +Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK + +[Install] +WantedBy=default.target