summaryrefslogtreecommitdiff
path: root/hosts/ahmed/torrenting
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/ahmed/torrenting')
-rw-r--r--hosts/ahmed/torrenting/save-path.nix36
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}
+ '';
};
};