mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
mpv: configure with wrappers
This commit is contained in:
@@ -1,49 +1,42 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
swallow = command: "${pkgs.swallow}/bin/swallow ${command}";
|
||||
myMpv =
|
||||
pkgs:
|
||||
self.inputs.wrappers.wrapperModules.mpv.apply {
|
||||
inherit pkgs;
|
||||
scripts = [
|
||||
pkgs.mpvScripts.visualizer
|
||||
];
|
||||
"mpv.conf".content = "";
|
||||
"mpv.input".content = ''
|
||||
Alt+- add video-zoom -0.25
|
||||
Alt+= add video-zoom 0.25
|
||||
Alt+LEFT add video-rotate -90
|
||||
Alt+RIGHT add video-rotate 90
|
||||
Alt+h add video-pan-x 0.05
|
||||
Alt+j add video-pan-y -0.05
|
||||
Alt+k add video-pan-y 0.05
|
||||
Alt+l add video-pan-x -0.05
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.shellAliases.smpv = swallow "mpv";
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
mpv = config.home-manager.users.me.programs.mpv.finalPackage;
|
||||
(final: prev: {
|
||||
mpv = (myMpv prev).wrapper;
|
||||
})
|
||||
];
|
||||
|
||||
home-manager.users.me = {
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
config = {
|
||||
ytdl-format = "bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best";
|
||||
ytdl-raw-options = lib.concatStringsSep "," [
|
||||
''sub-lang="de,en"''
|
||||
"write-sub="
|
||||
"write-auto-sub="
|
||||
];
|
||||
screenshot-template = "%F-%wH%wM%wS-%#04n";
|
||||
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
|
||||
ao = "pulse"; # no pipewire for me :(
|
||||
};
|
||||
bindings = {
|
||||
"Alt+RIGHT" = "add video-rotate 90";
|
||||
"Alt+LEFT" = "add video-rotate -90";
|
||||
"Alt+-" = "add video-zoom -0.25";
|
||||
"Alt+=" = "add video-zoom 0.25";
|
||||
"Alt+l" = "add video-pan-x -0.05";
|
||||
"Alt+h" = "add video-pan-x 0.05";
|
||||
"Alt+k" = "add video-pan-y 0.05";
|
||||
"Alt+j" = "add video-pan-y -0.05";
|
||||
};
|
||||
scripts = [
|
||||
# pkgs.mpvScripts.quality-menu
|
||||
# pkgs.mpvScripts.visualizer
|
||||
];
|
||||
};
|
||||
};
|
||||
environment.systemPackages = [
|
||||
((myMpv pkgs).wrapper)
|
||||
];
|
||||
}
|
||||
|
||||
23
flake.lock
generated
23
flake.lock
generated
@@ -695,7 +695,8 @@
|
||||
"treefmt-nix": "treefmt-nix_3",
|
||||
"voidrice": "voidrice",
|
||||
"wallpapers": "wallpapers",
|
||||
"wetter": "wetter"
|
||||
"wetter": "wetter",
|
||||
"wrappers": "wrappers_2"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
@@ -1090,6 +1091,26 @@
|
||||
"repo": "wrappers",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wrappers_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770311206,
|
||||
"narHash": "sha256-gzTvuaJZaymgxQC4rOZ9HlMRRWHVF2moEEaTnCG556A=",
|
||||
"owner": "lassulus",
|
||||
"repo": "wrappers",
|
||||
"rev": "241f2f7dfcac0dbb2338105bdba7f03f412c5847",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lassulus",
|
||||
"repo": "wrappers",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
16
flake.nix
16
flake.nix
@@ -25,6 +25,7 @@
|
||||
wallpapers.url = "github:kmein/wallpapers";
|
||||
nix-topology.url = "github:oddlama/nix-topology";
|
||||
wetter.url = "github:4z3/wetter";
|
||||
wrappers.url = "github:lassulus/wrappers";
|
||||
|
||||
voidrice.flake = false;
|
||||
wallpapers.flake = false;
|
||||
@@ -61,6 +62,7 @@
|
||||
tinc-graph.inputs.nixpkgs.follows = "nixpkgs";
|
||||
wetter.inputs.nixpkgs.follows = "nixpkgs";
|
||||
niphas.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
wrappers.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -244,12 +246,6 @@
|
||||
trans = prev.callPackage packages/trans.nix { }; # TODO upstream
|
||||
go-webring = prev.callPackage packages/go-webring.nix { }; # TODO upstream
|
||||
stag = prev.callPackage packages/stag.nix { }; # TODO upstream
|
||||
mpv = prev.mpv.override {
|
||||
scripts = [
|
||||
# final.mpvScripts.visualizer
|
||||
final.mpvScripts.mpris
|
||||
];
|
||||
};
|
||||
morris = prev.callPackage packages/morris.nix { };
|
||||
cro = prev.callPackage packages/cro.nix { };
|
||||
exodus = prev.callPackage packages/exodus.nix { };
|
||||
@@ -426,6 +422,7 @@
|
||||
{
|
||||
ful = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules =
|
||||
profiles.default
|
||||
++ profiles.server
|
||||
@@ -440,6 +437,7 @@
|
||||
};
|
||||
zaatar = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules =
|
||||
profiles.default
|
||||
++ profiles.server
|
||||
@@ -449,6 +447,7 @@
|
||||
};
|
||||
kibbeh = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules =
|
||||
profiles.default
|
||||
++ profiles.desktop
|
||||
@@ -458,6 +457,7 @@
|
||||
};
|
||||
makanek = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules =
|
||||
profiles.default
|
||||
++ profiles.server
|
||||
@@ -469,18 +469,21 @@
|
||||
};
|
||||
tahina = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules = profiles.default ++ [
|
||||
systems/tahina/configuration.nix
|
||||
];
|
||||
};
|
||||
tabula = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules = profiles.default ++ [
|
||||
systems/tabula/configuration.nix
|
||||
];
|
||||
};
|
||||
manakish = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules =
|
||||
profiles.default
|
||||
++ profiles.desktop
|
||||
@@ -491,6 +494,7 @@
|
||||
};
|
||||
kabsa = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit self; };
|
||||
modules =
|
||||
profiles.default
|
||||
++ profiles.desktop
|
||||
|
||||
Reference in New Issue
Block a user