diff options
author | Linnnus <[email protected]> | 2024-07-06 22:37:25 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-07-06 22:37:25 +0200 |
commit | a58eb58090932d154ce4e465d186557fe8503873 (patch) | |
tree | de9622d869675a7bac41b303f815aa0dce832265 /hosts/ahmed/torrenting/save-path.nix | |
parent | 654ebbc4af3285c484df3f2ec7a34646cc18ef36 (diff) |
ahmed: Formatting
Diffstat (limited to 'hosts/ahmed/torrenting/save-path.nix')
-rw-r--r-- | hosts/ahmed/torrenting/save-path.nix | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/hosts/ahmed/torrenting/save-path.nix b/hosts/ahmed/torrenting/save-path.nix index 9d57f06..d58babb 100644 --- a/hosts/ahmed/torrenting/save-path.nix +++ b/hosts/ahmed/torrenting/save-path.nix @@ -1,7 +1,12 @@ -{pkgs,lib,config,...}: let +{ + pkgs, + lib, + config, + ... +}: let downloadPath = "/srv/media/"; - categories = [ "Movies" "Anime Movies" "Anime Series" "Series" "Stand-up" "Miscellaneous" ]; + categories = ["Movies" "Anime Movies" "Anime Series" "Series" "Stand-up" "Miscellaneous"]; in { # Create the directory to which media will be downloaded. This will be used # by qBittorent to hold files and Jellyfin will serve from it. @@ -13,15 +18,15 @@ in { # Configure qBittorrent to use the correct save path. services.qbittorrent.settings = { - BitTorrent = { - "Session\\DefaultSavePath" = assert builtins.elem "Miscellaneous" categories; "${downloadPath}/Miscellaneous"; - "Session\\TempPath" = "${config.services.qbittorrent.profile}/qBittorrent/temp"; - "Session\\TempPathEnabled" = true; - }; - Preferences = { - # Again?? - "Downloads\\SavePath" = downloadPath; - }; + BitTorrent = { + "Session\\DefaultSavePath" = assert builtins.elem "Miscellaneous" categories; "${downloadPath}/Miscellaneous"; + "Session\\TempPath" = "${config.services.qbittorrent.profile}/qBittorrent/temp"; + "Session\\TempPathEnabled" = true; + }; + Preferences = { + # Again?? + "Downloads\\SavePath" = downloadPath; + }; }; # Create categories for qBittorrent with correct save paths. @@ -37,12 +42,13 @@ in { User = config.services.qbittorrent.user; Group = config.services.qbittorrent.group; ExecStart = let - categoriesJson = lib.genAttrs categories (c: { "save_path" = "${downloadPath}/${c}"; }); + categoriesJson = lib.genAttrs categories (c: {"save_path" = "${downloadPath}/${c}";}); categoriesFile = (pkgs.formats.json {}).generate "categories.json" categoriesJson; categoriesPath = "${config.services.qbittorrent.profile}/qBittorrent/config/categories.json"; - in pkgs.writeShellScript "qbittorrent-create-categories.sh" '' - ln -s -f ${categoriesFile} ${categoriesPath} - ''; + in + pkgs.writeShellScript "qbittorrent-create-categories.sh" '' + ln -s -f ${categoriesFile} ${categoriesPath} + ''; }; }; |