feat: add mpv module
This commit is contained in:
parent
e879182969
commit
f46004e976
39
modules/home/applications/mpv.nix
Normal file
39
modules/home/applications/mpv.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
osConfig ? null,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
|
cfg = config.ataraxia.programs.mpv;
|
||||||
|
|
||||||
|
gpu = if (osConfig != null) then osConfig.ataraxia.defaults.hardware.gpuVendor else null;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.ataraxia.programs.mpv = {
|
||||||
|
enable = mkEnableOption "Enable mpv program";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.mpv = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
vo = "gpu-next";
|
||||||
|
gpu-context = "wayland";
|
||||||
|
save-position-on-quit = "yes";
|
||||||
|
hwdec = if gpu == "nvidia" then "vdpau" else "vaapi";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultApplications.media-player = {
|
||||||
|
cmd = "${config.programs.mpv.package}/bin/mpv";
|
||||||
|
desktop = "mpv";
|
||||||
|
};
|
||||||
|
|
||||||
|
persist.state.directories = [
|
||||||
|
".config/mpv"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -81,6 +81,7 @@ in
|
|||||||
ataraxia.programs.default.enable = mkDefault true;
|
ataraxia.programs.default.enable = mkDefault true;
|
||||||
ataraxia.programs.firefox.enable = mkDefault true;
|
ataraxia.programs.firefox.enable = mkDefault true;
|
||||||
ataraxia.programs.kitty.enable = mkDefault true;
|
ataraxia.programs.kitty.enable = mkDefault true;
|
||||||
|
ataraxia.programs.mpv.enable = mkDefault true;
|
||||||
ataraxia.programs.vscode.enable = mkDefault true;
|
ataraxia.programs.vscode.enable = mkDefault true;
|
||||||
ataraxia.wayland.enable = mkDefault true;
|
ataraxia.wayland.enable = mkDefault true;
|
||||||
ataraxia.wayland.hyprland.enable = mkDefault true;
|
ataraxia.wayland.hyprland.enable = mkDefault true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user