From 131a6b1d8b91f44d5148598ebec4df7f9b64e460 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Tue, 1 Sep 2020 22:27:22 +0200 Subject: [PATCH] syncthing: add versioning to the most important folders --- configs/pepe/home-assistant/light-control.nix | 2 +- configs/workhorse/mattermost.nix | 2 +- configs/workhorse/syncthing.nix | 36 ---------------- configs/workhorse/transmission.nix | 2 +- configs/workout/syncthing.nix | 36 ---------------- system/all/syncthing.nix | 41 ++++++++++++++++++- 6 files changed, 43 insertions(+), 76 deletions(-) diff --git a/configs/pepe/home-assistant/light-control.nix b/configs/pepe/home-assistant/light-control.nix index 7c16d3f..d88bcb3 100644 --- a/configs/pepe/home-assistant/light-control.nix +++ b/configs/pepe/home-assistant/light-control.nix @@ -13,7 +13,7 @@ { name = "outside"; room_tracking_enabled = false; - ignored_sensors = ["zigbee2mqtt/door_sensor_4"]; + ignored_sensors = [ "zigbee2mqtt/door_sensor_4" ]; } { name = "cooking"; diff --git a/configs/workhorse/mattermost.nix b/configs/workhorse/mattermost.nix index fd154d2..0622265 100644 --- a/configs/workhorse/mattermost.nix +++ b/configs/workhorse/mattermost.nix @@ -97,7 +97,7 @@ in { services.SystemdJournal2Gelf.enable = true; services.SystemdJournal2Gelf.graylogServer = "${hostAddress}:11201"; - services.journald.extraConfig = ''SystemMaxUse=1G''; + services.journald.extraConfig = "SystemMaxUse=1G"; }; }; diff --git a/configs/workhorse/syncthing.nix b/configs/workhorse/syncthing.nix index 780ef64..35b9fad 100644 --- a/configs/workhorse/syncthing.nix +++ b/configs/workhorse/syncthing.nix @@ -28,10 +28,6 @@ private = { enable = true; path = "/home/syncthing/private"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; desktop = { enable = true; @@ -40,18 +36,10 @@ finance = { enable = true; path = "/home/syncthing/finance"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; fotos = { enable = true; path = "/home/syncthing/fotos"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; lost-fotos = { enable = true; @@ -64,10 +52,6 @@ zettlr = { enable = true; path = "/home/syncthing/zettlr"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; # on media hard drive (not encrypted) @@ -90,46 +74,26 @@ enable = true; path = "/media/syncthing/samples"; rescanInterval = 8 * 3600; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; movies = { enable = true; path = "/media/syncthing/movies"; rescanInterval = 8 * 3600; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; music-library = { enable = true; path = "/media/syncthing/music-library"; rescanInterval = 8 * 3600; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; series = { enable = true; path = "/media/syncthing/series"; rescanInterval = 8 * 3600; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; smartphone-folder = { enable = true; path = "/media/syncthing/smartphone-folder"; rescanInterval = 8 * 3600; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; }; diff --git a/configs/workhorse/transmission.nix b/configs/workhorse/transmission.nix index 6bc6f67..1384162 100644 --- a/configs/workhorse/transmission.nix +++ b/configs/workhorse/transmission.nix @@ -47,7 +47,7 @@ in { services.SystemdJournal2Gelf.enable = true; services.SystemdJournal2Gelf.graylogServer = "${hostAddress}:11201"; - services.journald.extraConfig = ''SystemMaxUse=1G''; + services.journald.extraConfig = "SystemMaxUse=1G"; services.transmission = { enable = true; diff --git a/configs/workout/syncthing.nix b/configs/workout/syncthing.nix index 3e286da..9fab980 100644 --- a/configs/workout/syncthing.nix +++ b/configs/workout/syncthing.nix @@ -22,10 +22,6 @@ finance = { enable = true; path = "/home/palo/finance"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; lost-fotos = { enable = true; @@ -34,10 +30,6 @@ fotos = { enable = true; path = "/home/palo/fotos"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; # no need to be encrypted @@ -45,50 +37,26 @@ book = { enable = true; path = "/home/palo/books"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; music-library-free = { enable = true; path = "/home/palo/music-library-free"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; music-library = { enable = true; path = "/home/palo/music-library"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; music-projects = { enable = true; path = "/home/palo/music-projects"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; samples = { enable = true; path = "/home/palo/samples"; - versioning = { - type = "simple"; - params.keep = "2"; - }; }; video-material = { enable = true; path = "/home/palo/video-material"; - versioning = { - type = "simple"; - params.keep = "2"; - }; }; windows-sync = { enable = true; @@ -101,10 +69,6 @@ zettlr = { enable = true; path = "/home/palo/zettlr"; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; }; }; diff --git a/system/all/syncthing.nix b/system/all/syncthing.nix index 032e180..1886f01 100644 --- a/system/all/syncthing.nix +++ b/system/all/syncthing.nix @@ -60,6 +60,10 @@ with lib; { enable = lib.mkDefault false; watch = false; devices = [ "workout" "workhorse" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; desktop = { enable = lib.mkDefault false; @@ -70,16 +74,28 @@ with lib; { enable = lib.mkDefault false; watch = false; devices = [ "workout" "workhorse" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; fotos = { enable = lib.mkDefault false; watch = false; devices = [ "workout" "workhorse" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; zettlr = { enable = lib.mkDefault false; watch = true; devices = [ "workout" "workhorse" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; # no need to be stored on encrypted drives @@ -89,12 +105,20 @@ with lib; { id = "wwbvs-5lfbh"; watch = false; devices = [ "workout" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; movies = { enable = lib.mkDefault false; id = "vatmy-c2qf4"; watch = false; devices = [ "workhorse" "pepe" "porani" ]; + versioning = { + type = "simple"; + params.keep = "3"; + }; }; porn = { enable = lib.mkDefault false; @@ -106,6 +130,10 @@ with lib; { id = "gytmq-r2zrx"; watch = false; devices = [ "porani" "workout" "workhorse" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; music-library-free = { enable = lib.mkDefault false; @@ -118,6 +146,10 @@ with lib; { id = "acfhu-r4t4f"; watch = false; devices = [ "workout" "workhorse" "pepe" "sterni" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; smartphone-folder = { enable = lib.mkDefault false; @@ -135,14 +167,21 @@ with lib; { id = "all-series"; watch = false; devices = [ "workhorse" "porani" "pepe" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; video-material = { enable = lib.mkDefault false; id = "wgkun-fec5h"; watch = false; devices = [ "workout" "workhorse" "pepe" ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; }; - windows-sync = { enable = lib.mkDefault false; id = "hcity-p5ikc";