mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
24 lines
513 B
Nix
24 lines
513 B
Nix
{ config, lib, pkgs, user, ... }:
|
|
|
|
let cfg = config.modules.programs.yt-dlp;
|
|
in {
|
|
options.modules.programs.yt-dlp = with lib; {
|
|
enable = lib.mkOption {
|
|
type = with types; bool;
|
|
default = true;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs; [
|
|
yt-dlp
|
|
(pkgs.writeScriptBin "ytd_audio" ''
|
|
#!/usr/bin/env bash
|
|
yt-dlp -x \
|
|
-ciw -o "%(title)s.%(ext)s" \
|
|
--embed-thumbnail -S acodec:m4a "$1"
|
|
'')
|
|
];
|
|
};
|
|
}
|