2023-08-27 19:26:12 +03:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
2023-09-06 16:10:11 +03:00
|
|
|
let cfg = config.my.roles.media-client;
|
2023-08-27 19:26:12 +03:00
|
|
|
in {
|
2023-09-06 16:10:11 +03:00
|
|
|
options.my.roles.media-client.enable =
|
|
|
|
lib.mkEnableOption "Enable media players, downloaders, etc.";
|
|
|
|
config = lib.mkIf (cfg.enable) {
|
2024-01-01 16:32:29 +03:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
(self: super: {
|
2024-01-02 17:17:59 +03:00
|
|
|
mpv = (super.wrapMpv (super.mpv.unwrapped.override {
|
2024-01-01 16:32:29 +03:00
|
|
|
cddaSupport = true;
|
|
|
|
# No pulse today
|
|
|
|
pulseSupport = false;
|
|
|
|
pipewireSupport = true;
|
|
|
|
screenSaverSupport = false;
|
|
|
|
# MATE only
|
|
|
|
x11Support = config.my.roles.graphical.basic.enable;
|
|
|
|
# Sway only
|
|
|
|
waylandSupport = config.my.roles.graphical.enable;
|
|
|
|
javascriptSupport = false;
|
2024-01-02 17:17:59 +03:00
|
|
|
}) { }).override { scripts = [ self.mpvScripts.mpris ]; };
|
2024-01-01 16:32:29 +03:00
|
|
|
})
|
|
|
|
];
|
|
|
|
environment.systemPackages = with pkgs; [ vlc yt-dlp ffmpeg mpv ];
|
|
|
|
|
2024-01-02 17:17:59 +03:00
|
|
|
# Setting up only for ivabus user, because user user will use Firefox or anything else to play videos
|
|
|
|
home-manager.users.ivabus = lib.mkIf (config.my.users.ivabus.enable) {
|
|
|
|
programs.mpv = {
|
|
|
|
enable = true;
|
|
|
|
config = {
|
|
|
|
profile = "gpu-hq";
|
|
|
|
ytdl-format = "bestvideo+bestaudio";
|
|
|
|
sub-font = "JetBrains Mono";
|
|
|
|
sub-scale = "0.6";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-01 16:32:29 +03:00
|
|
|
# Add support for CD/DVD/BD drives
|
|
|
|
boot.initrd.availableKernelModules = [ "sr_mod" ];
|
2023-08-27 19:26:12 +03:00
|
|
|
};
|
2023-09-06 16:10:11 +03:00
|
|
|
}
|