diff --git a/hosts/tempest/default.nix b/hosts/tempest/default.nix index 36ba623..ff80012 100644 --- a/hosts/tempest/default.nix +++ b/hosts/tempest/default.nix @@ -49,6 +49,7 @@ nixpkgs.lib.nixosSystem { # mullvad.enable = true; nixlang.enable = true; dotfiles.enable = true; + yt-dlp.enable = true; gaming = { enable = true; diff --git a/modules/common/applications/default.nix b/modules/common/applications/default.nix index 957b460..942f8d4 100644 --- a/modules/common/applications/default.nix +++ b/modules/common/applications/default.nix @@ -10,6 +10,7 @@ ./obsidian.nix ./qbittorrent.nix ./nautilus.nix + ./yt-dlp.nix ]; } diff --git a/modules/common/applications/media.nix b/modules/common/applications/media.nix index aa13f82..84fe7eb 100644 --- a/modules/common/applications/media.nix +++ b/modules/common/applications/media.nix @@ -16,7 +16,6 @@ sxiv # Image viewer mupdf # PDF viewer zathura # PDF viewer - yt-dlp # Video downloader ]; # Set default for opening PDFs diff --git a/modules/common/applications/yt-dlp.nix b/modules/common/applications/yt-dlp.nix new file mode 100644 index 0000000..33fab4c --- /dev/null +++ b/modules/common/applications/yt-dlp.nix @@ -0,0 +1,35 @@ +{ config, pkgs, lib, ... }: { + + options = { + yt-dlp = { + enable = lib.mkEnableOption { + description = "Enable YouTube downloader."; + default = false; + }; + }; + }; + + config = lib.mkIf (config.yt-dlp.enable) { + home-manager.users.${config.user} = { + programs.yt-dlp = { + enable = true; + extraConfig = ""; + settings = { + no-continue = true; # Always re-download each fragment + no-overwrites = true; # Don't overwrite existing files + download-archive = "archive.log"; # Log of archives + embed-metadata = true; + embed-thumbnail = true; + embed-subs = true; + sub-langs = "en.*"; + concurrent-fragments = 4; # Parallel download chunks + }; + }; + + programs.fish.shellAbbrs.yt = "yt-dlp"; + + }; + + }; + +} diff --git a/modules/nixos/system/user.nix b/modules/nixos/system/user.nix index 5895624..3d2f09e 100644 --- a/modules/nixos/system/user.nix +++ b/modules/nixos/system/user.nix @@ -32,6 +32,11 @@ }; home-manager.users.${config.user}.xdg = { + + # Allow Nix to manage the default applications list + mimeApps.enable = true; + + # Set directories for application defaults userDirs = { enable = true; createDirectories = true;