diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-30 13:27:39 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-12-30 13:27:39 +0100 |
commit | a6c4828cb66eb74ef2320f9fa06b59ae299e5c5f (patch) | |
tree | 5ded6485f84fb80dcf3def315762b9a61ef74c39 /configuration.nix | |
parent | 424e7ae22ca6c2c44574821eff9600997ab96252 (diff) | |
download | nixcfg-a6c4828cb66eb74ef2320f9fa06b59ae299e5c5f.tar.gz nixcfg-a6c4828cb66eb74ef2320f9fa06b59ae299e5c5f.zip |
Add systemd service to mount garage
Diffstat (limited to 'configuration.nix')
-rw-r--r-- | configuration.nix | 19 |
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; |