dotfiles

My PC Dotfiles & Website

modules/apps/youtube.nix (905B)


 1## YT Configuration ##
 2{config, ...}: let
 3  inherit (config.flake) files;
 4in {
 5  flake.modules.homeManager.youtube = {
 6    config,
 7    lib,
 8    pkgs,
 9    osConfig ? {},
10    ...
11  }: let
12    isWM = (osConfig.programs.hyprland.enable or false) || (osConfig.programs.niri.enable or false);
13    style =
14      if isWM
15      then "@import url('https://youtubemusic.catppuccin.com/src/${config.catppuccin.flavor}.css');"
16      else "";
17  in {
18    config.home = {
19      packages = with pkgs; [
20        pear-desktop
21        youtube-tui
22        yt-dlp
23      ];
24
25      persist.directories = [
26        ".config/pear-desktop"
27        ".config/youtube-tui"
28        ".local/share/youtube-tui"
29      ];
30
31      file.".config/pear-desktop/config.json" = {
32        text = lib.replaceStrings ["@theme"] [(builtins.toFile "style.css" style)] files.youtube;
33        mutable = true;
34        force = true;
35      };
36    };
37  };
38}