From f3d6e88997f73e39166636641d3f9c45c268236d Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 12 Mar 2023 17:50:01 +0100 Subject: [PATCH] fixing syncthing iowait on rescan --- nixos/machines/pepe/syncthing.nix | 31 ++++----------- nixos/machines/pepe/telegraf.nix | 4 +- nixos/machines/robi/nextcloud.nix | 26 ++----------- nixos/machines/robi/syncthing.nix | 26 ++----------- nixos/machines/robi/telegraf.nix | 4 +- nixos/machines/robi/transmission.nix | 6 +-- nixos/machines/robi/transmission2.nix | 6 +-- nixos/machines/sternchen/configuration.nix | 4 -- nixos/system/all/syncthing.nix | 45 +--------------------- 9 files changed, 25 insertions(+), 127 deletions(-) diff --git a/nixos/machines/pepe/syncthing.nix b/nixos/machines/pepe/syncthing.nix index 6903f64..b200992 100644 --- a/nixos/machines/pepe/syncthing.nix +++ b/nixos/machines/pepe/syncthing.nix @@ -5,11 +5,7 @@ custom.samba-share = { enable = true; folders = { - movies = config.services.syncthing.folders.movies.path; - music = config.services.syncthing.folders.music-library.path; - samples = config.services.syncthing.folders.samples.path; - series = config.services.syncthing.folders.series.path; - books = config.services.syncthing.folders.books.path; + media = config.services.syncthing.folders.media.path; }; private.upload = { folder = "/media/upload"; @@ -75,15 +71,14 @@ path = "/media/syncthing/lost-fotos.ct"; rescanInterval = 5 * 31 * 24 * 3600; }; - movies = { + media = { enable = true; - path = "/media/syncthing/movies"; - rescanInterval = 8 * 3600; - }; - music-library = { - enable = true; - path = "/media/syncthing/music-library"; - rescanInterval = 8 * 3600; + path = "/media/syncthing/media"; + rescanInterval = 120 * 3600; + versioning = { + type = "simple"; + params.keep = "3"; + }; }; music-projects = { enable = true; @@ -95,16 +90,6 @@ path = "/media/syncthing/nextcloud_backup"; rescanInterval = 8 * 3600; }; - samples = { - enable = true; - path = "/media/syncthing/samples"; - rescanInterval = 8 * 3600; - }; - series = { - enable = true; - path = "/media/syncthing/series"; - rescanInterval = 8 * 3600; - }; }; }; diff --git a/nixos/machines/pepe/telegraf.nix b/nixos/machines/pepe/telegraf.nix index 7e05d1a..c1effa3 100644 --- a/nixos/machines/pepe/telegraf.nix +++ b/nixos/machines/pepe/telegraf.nix @@ -20,8 +20,8 @@ in }; # https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins inputs = { - cpu = {}; - diskio = {}; + cpu = { }; + diskio = { }; x509_cert = [{ sources = (map (url: "${url.url}:443") urls); interval = "30m"; # agent.interval = "10s" is default diff --git a/nixos/machines/robi/nextcloud.nix b/nixos/machines/robi/nextcloud.nix index a9f0803..3338a39 100644 --- a/nixos/machines/robi/nextcloud.nix +++ b/nixos/machines/robi/nextcloud.nix @@ -138,29 +138,9 @@ in mountPoint = "/var/lib/mysql"; isReadOnly = false; }; - samples = { - mountPoint = toString config.services.syncthing.folders.samples.path; - hostPath = toString config.services.syncthing.folders.samples.path; - isReadOnly = true; - }; - movies = { - mountPoint = toString config.services.syncthing.folders.movies.path; - hostPath = toString config.services.syncthing.folders.movies.path; - isReadOnly = true; - }; - music = { - mountPoint = toString config.services.syncthing.folders.music-library.path; - hostPath = toString config.services.syncthing.folders.music-library.path; - isReadOnly = true; - }; - series = { - mountPoint = toString config.services.syncthing.folders.series.path; - hostPath = toString config.services.syncthing.folders.series.path; - isReadOnly = true; - }; - books = { - mountPoint = toString config.services.syncthing.folders.books.path; - hostPath = toString config.services.syncthing.folders.books.path; + media = { + mountPoint = toString config.services.syncthing.folders.media.path; + hostPath = toString config.services.syncthing.folders.media.path; isReadOnly = true; }; }; diff --git a/nixos/machines/robi/syncthing.nix b/nixos/machines/robi/syncthing.nix index 0cc8960..1d250fa 100644 --- a/nixos/machines/robi/syncthing.nix +++ b/nixos/machines/robi/syncthing.nix @@ -19,7 +19,6 @@ key = toString config.sops.secrets.syncthing_key.path; folders = { - # on media hard drive (not encrypted) # ----------------------------------- #borg-mirror = { @@ -41,17 +40,11 @@ path = "/media/syncthing/lost-fotos.ct"; rescanInterval = 40 * 24 * 3600; }; - movies = { + media = { enable = true; watch = true; - path = "/media/syncthing/movies"; - rescanInterval = 16 * 3600; - }; - music-library = { - enable = true; - watch = true; - path = "/media/syncthing/music"; - rescanInterval = 2 * 24 * 3600; + path = "/media/syncthing/media"; + rescanInterval = 3 * 24 * 3600; }; music-projects = { enable = true; @@ -64,19 +57,6 @@ path = "/media/syncthing/nextcloud_backup"; rescanInterval = 23 * 3600; }; - samples = { - enable = true; - watch = true; - path = "/media/syncthing/samples"; - rescanInterval = 41 * 24 * 3600; - }; - series = { - enable = true; - watch = true; - path = "/media/syncthing/series"; - rescanInterval = 15 * 3600; - }; - }; }; diff --git a/nixos/machines/robi/telegraf.nix b/nixos/machines/robi/telegraf.nix index 280b4ac..caa8d24 100644 --- a/nixos/machines/robi/telegraf.nix +++ b/nixos/machines/robi/telegraf.nix @@ -8,8 +8,8 @@ }; # https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins inputs = { - cpu = {}; - diskio = {}; + cpu = { }; + diskio = { }; processes = { }; systemd_units = { }; nginx.urls = [ "http://localhost/nginx_status" ]; diff --git a/nixos/machines/robi/transmission.nix b/nixos/machines/robi/transmission.nix index 94918c4..5ac7207 100644 --- a/nixos/machines/robi/transmission.nix +++ b/nixos/machines/robi/transmission.nix @@ -35,9 +35,9 @@ let completionScript = let copy_map = { - "/media/torrent/downloads/series" = "/media/syncthing/series/incoming"; - "/media/torrent/downloads/music" = "/media/syncthing/music/incoming"; - "/media/torrent/downloads/movies" = "/media/syncthing/movies/incoming"; + "/media/torrent/downloads/series" = "/media/syncthing/media/incoming/series"; + "/media/torrent/downloads/music" = "/media/syncthing/media/incoming/music"; + "/media/torrent/downloads/movies" = "/media/syncthing/media/incoming/movies"; "/media/torrent/downloads" = "/media/torrent/incoming"; }; copy_script = lib.concatStringsSep "\n" (lib.mapAttrsToList diff --git a/nixos/machines/robi/transmission2.nix b/nixos/machines/robi/transmission2.nix index e60ec24..604ced3 100644 --- a/nixos/machines/robi/transmission2.nix +++ b/nixos/machines/robi/transmission2.nix @@ -31,9 +31,9 @@ let completionScript = let copy_map = { - "/media/torrent/downloads/series" = "/media/syncthing/series/incoming"; - "/media/torrent/downloads/music" = "/media/syncthing/music/incoming"; - "/media/torrent/downloads/movies" = "/media/syncthing/movies/incoming"; + "/media/torrent/downloads/series" = "/media/syncthing/media/incoming/series"; + "/media/torrent/downloads/music" = "/media/syncthing/media/incoming/music"; + "/media/torrent/downloads/movies" = "/media/syncthing/media/incoming/movies"; "/media/torrent/downloads" = "/media/torrent/incoming"; }; copy_script = lib.concatStringsSep "\n" (lib.mapAttrsToList diff --git a/nixos/machines/sternchen/configuration.nix b/nixos/machines/sternchen/configuration.nix index f3d1e45..83136db 100644 --- a/nixos/machines/sternchen/configuration.nix +++ b/nixos/machines/sternchen/configuration.nix @@ -89,11 +89,7 @@ custom.samba-share = { enable = false; folders = { - #public = "/home/palo/movies"; share = "/home/share"; - #syncthing = "/mnt/syncthing"; - #movies = "/mnt/syncthing/movies"; - #series = "/mnt/syncthing/series"; }; }; diff --git a/nixos/system/all/syncthing.nix b/nixos/system/all/syncthing.nix index a68a11a..ffe01dc 100644 --- a/nixos/system/all/syncthing.nix +++ b/nixos/system/all/syncthing.nix @@ -98,16 +98,6 @@ with lib; { # no need to be stored on encrypted drives # ---------------------------------------- - books = { - enable = lib.mkDefault false; - id = "wwbvs-5lfbh"; - watch = lib.mkDefault false; - devices = [ "pepe" "cream" "sterni" "robi" ]; - versioning = { - type = "simple"; - params.keep = "10"; - }; - }; lost-fotos = { enable = lib.mkDefault false; watch = lib.mkDefault false; @@ -117,25 +107,10 @@ with lib; { params.keep = "10"; }; }; - movies = { + media = { enable = lib.mkDefault false; - id = "vatmy-c2qf4"; watch = lib.mkDefault false; devices = [ "pepe" "robi" ]; - versioning = { - type = "simple"; - params.keep = "3"; - }; - }; - music-library = { - enable = lib.mkDefault false; - id = "gytmq-r2zrx"; - watch = lib.mkDefault false; - devices = [ "pepe" "cream" "sterni" "robi" ]; - versioning = { - type = "simple"; - params.keep = "10"; - }; }; music-projects = { enable = lib.mkDefault false; @@ -156,25 +131,7 @@ with lib; { params.keep = "2"; }; }; - samples = { - enable = lib.mkDefault false; - id = "pcgkj-tjucd"; - watch = lib.mkDefault false; - devices = [ "pepe" "robi" ]; - }; - series = { - enable = lib.mkDefault false; - id = "all-series"; - watch = lib.mkDefault false; - devices = [ "pepe" "robi" ]; - versioning = { - type = "simple"; - params.keep = "10"; - }; - }; - }; - }; }