blob: 045094db982520a922661b85c48b5957c4a8ed37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
{ config, userName, pkgs, ... }:
{
home-manager.users.${userName}.programs.mpv = {
enable = true;
bindings = {
"CTRL+n" = "af toggle \"lavfi=[dynaudnorm=f=100:g=31:s=20.0]\"";
};
config = {
ytdl = true;
ytdl-format = "bestvideo[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]/best[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]/best[protocol!=http_dash_segments]";
ytdl-raw-options = "netrc=,mark-watched=,cookies=${config.home-manager.users.${userName}.home.homeDirectory}/Downloads/cookies.txt";
sub = false;
osd-font = "DejaVu Sans";
vo = "gpu";
hwdec = "auto";
force-window = "yes";
script-opts = "osc-layout=topbar,vidscale=no,deadzonesize=0.9";
af = "lavfi=[dynaudnorm=f=100:g=31:s=20.0]";
};
scripts = let
reload = pkgs.stdenv.mkDerivation rec {
version = "2b8a719f";
pname = "reload";
name = "${pname}-${version}";
src = pkgs.fetchFromGitHub {
owner = "4e6";
repo = "mpv-reload";
rev = "2b8a719fe166d6d42b5f1dd64761f97997b54a86";
sha256 = "19ycvnwzf8vgv0g63d4k1ll6hlfrd92is9gl8hzfic7w32ycphbg";
};
installPhase = ''
install -d $out/share/mpv/scripts
install -m 0644 reload.lua $out/share/mpv/scripts/${passthru.scriptName}
'';
passthru.scriptName = "reload.lua";
};
autosave = pkgs.stdenv.mkDerivation rec {
version = "0bv9wjrq";
pname = "autosave";
name = "${pname}-${version}.lua";
src = pkgs.fetchzip {
url = "https://gist.github.com/Hakkin/5489e511bd6c8068a0fc09304c9c5a82/archive/7a19f7cdb6dd0b1c6878b41e13b244e2503c15fc.zip";
sha256 = "0bv9wjrqm2ragd7rp8vw768bja2ghascwlljd6rzzf2ybi10fxs2";
};
installPhase = ''
install -d $out/share/mpv/scripts
install -m 0644 autosave.lua $out/share/mpv/scripts/${passthru.scriptName}
'';
passthru.scriptName = "autosave.lua";
};
mpris = pkgs.stdenv.mkDerivation rec {
version = "0.4";
pname = "mpv-mpris";
name = "${pname}-${version}.so";
src = pkgs.fetchFromGitHub {
owner = "hoyon";
repo = "mpv-mpris";
rev = version;
sha256 = "1fr3jvja8s2gdpx8qyk9r17977flms3qpm8zci62nd9r5wjdvr5i";
};
installPhase = ''
install -d $out/share/mpv/scripts
install -m 0644 mpris.so $out/share/mpv/scripts/${passthru.scriptName}
'';
nativeBuildInputs = with pkgs; [ pkgconfig glib mpv ];
passthru.scriptName = "mpris.so";
};
in [ reload
autosave
mpris
];
};
}
|