aboutsummaryrefslogtreecommitdiff
path: root/configuration.nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-30 13:27:39 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-30 13:27:39 +0100
commita6c4828cb66eb74ef2320f9fa06b59ae299e5c5f (patch)
tree5ded6485f84fb80dcf3def315762b9a61ef74c39 /configuration.nix
parent424e7ae22ca6c2c44574821eff9600997ab96252 (diff)
downloadnixcfg-a6c4828cb66eb74ef2320f9fa06b59ae299e5c5f.tar.gz
nixcfg-a6c4828cb66eb74ef2320f9fa06b59ae299e5c5f.zip
Add systemd service to mount garage
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix
index c9fecd0..bb44c40 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -176,6 +176,7 @@ in
htop
links
git
+ rclone
docker
docker-compose
];
@@ -243,6 +244,24 @@ in
];
};
+ # Mount Garage using Rclone
+ systemd.services.mountgarage = {
+ enable = true;
+ description = "Mount the Garage data store";
+ path = [
+ pkgs.fuse
+ pkgs.rclone
+ ];
+ unitConfig = {
+ Type = "simple";
+ };
+ serviceConfig = {
+ ExecStartPre = "${pkgs.bash}/bin/sh -c \"mkdir -p /mnt/garage-staging; fusermount -u /mnt/garage-staging || exit 0\"";
+ ExecStart = "${pkgs.rclone}/bin/rclone --config /root/rclone.conf mount --vfs-cache-mode full --vfs-cache-max-size 1G --cache-dir /root/mountgarage-cache staging: /mnt/garage-staging";
+ };
+ wantedBy = [ "multi-user.target" ];
+ };
+
# Open ports in the firewall.
networking.firewall = {
enable = true;