From 2c4e604049ef625049d1fbb6ad241dffea800bea Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Sun, 10 Sep 2023 13:12:57 -0500 Subject: Add system roles System roles handle system level configuration like systemd services, wireguard etc. --- src/system/files/systemd/sys/wireguard.service | 14 ++++++++++++++ src/system/files/systemd/user/syncthing.service | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/system/files/systemd/sys/wireguard.service create mode 100644 src/system/files/systemd/user/syncthing.service (limited to 'src/system/files/systemd') diff --git a/src/system/files/systemd/sys/wireguard.service b/src/system/files/systemd/sys/wireguard.service new file mode 100644 index 0000000..76a2968 --- /dev/null +++ b/src/system/files/systemd/sys/wireguard.service @@ -0,0 +1,14 @@ +[Unit] +Description=Wireguard +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +RemainAfterExit=true +User=root +ExecStart=/usr/bin/wg-quick up wg0 +ExecStop=/usr/bin/wg-quick down wg0 + +[Install] +WantedBy=multi-user.target diff --git a/src/system/files/systemd/user/syncthing.service b/src/system/files/systemd/user/syncthing.service new file mode 100644 index 0000000..67fa2cd --- /dev/null +++ b/src/system/files/systemd/user/syncthing.service @@ -0,0 +1,13 @@ +[Unit] +Description=Syncthing podman container +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=/usr/bin/podman-compose -f /home/aaditya/containers/syncthing/compose.yaml up -d +ExecStop=/usr/bin/podman-compose -f /home/aaditya/containers/syncthing/compose.yaml down + +[Install] +WantedBy=multi-user.target -- cgit