This commit is contained in:
Peder Bergebakken Sundt 2023-06-20 01:39:19 +02:00
parent 1405e7f020
commit c83b9d5d32
3 changed files with 46 additions and 4 deletions

View File

@ -67,8 +67,15 @@
}; };
mkConfig = hostname: system: modules: nixlib.nixosSystem { mkConfig = hostname: system: modules: nixlib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit inputs; }; specialArgs = {
inherit inputs;
packages = self.packages.${system};
};
modules = modules ++ [ ./base.nix "${self}/hosts/${hostname}" tmpConfig ({ modules = modules ++ [ ./base.nix "${self}/hosts/${hostname}" tmpConfig ({
home-manager.extraSpecialArgs = {
inherit inputs;
packages = self.packages.${system};
};
networking.hostName = hostname; networking.hostName = hostname;
networking.domain = "pbsds.net"; networking.domain = "pbsds.net";
networking.search = [ "pbsds.net" ]; networking.search = [ "pbsds.net" ];
@ -96,6 +103,7 @@
inherit inputs; inherit inputs;
packages = forAllSystems({ pkgs, ... }: { packages = forAllSystems({ pkgs, ... }: {
mpv-webm = pkgs.callPackage ./pkgs/mpv-webm.nix {};
remote-exec = pkgs.python3Packages.callPackage "${inputs.pr-remote-exec}/pkgs/tools/misc/remote-exec" {}; remote-exec = pkgs.python3Packages.callPackage "${inputs.pr-remote-exec}/pkgs/tools/misc/remote-exec" {};
}); });
@ -107,9 +115,10 @@
sopp = mkConfig "sopp" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]); sopp = mkConfig "sopp" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]);
}; };
homeConfigurations = forAllSystems ({ pkgs, ... }: let homeConfigurations = forAllSystems ({ pkgs, system, ... }: let
mkHome = modules: home-manager.lib.homeManagerConfiguration { mkHome = modules: home-manager.lib.homeManagerConfiguration {
inherit pkgs modules; inherit pkgs modules;
extraSpecialArgs = { packages = self.packages.${system}; };
}; };
in { in {
pbsds = mkHome [ ./users/pbsds/home ]; pbsds = mkHome [ ./users/pbsds/home ];

28
pkgs/mpv-webm.nix Normal file
View File

@ -0,0 +1,28 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, luaPackages
}:
stdenvNoCC.mkDerivation {
pname = "mpv-webm";
version = "unstable-2023-02-23";
src = fetchFromGitHub {
owner = "ekisu";
repo = "mpv-webm";
rev = "a18375932e39e9b2a40d9c7ab52ea367b41e2558";
hash = "sha256-aetkQ1gU/6Yys5FJS/N06ED9tCSvL6BAgUGdNmNmpbU=";
};
nativeBuildInputs = [ luaPackages.moonscript ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/mpv/scripts
install -m 644 build/webm.lua $out/share/mpv/scripts/
runHook postInstall
'';
passthru.scriptName = "webm.lua";
}

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, packages, ... }:
{ {
#home.packages = with pkgs; [ mpv ]; #home.packages = with pkgs; [ mpv ];
@ -7,7 +7,12 @@
programs.mpv.bindings."SHIFT+n" = "sub-seek -1"; programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
programs.mpv.bindings."b" = ''cycle-values audio-channels 2 "auto"''; programs.mpv.bindings."b" = ''cycle-values audio-channels 2 "auto"'';
#programs.mpv.scripts = with pkgs.mpvScripts; [ thumbnail mpris ]; programs.mpv.scripts = with pkgs.mpvScripts; [
#thumbnail # TOO SLOW
#mpris
# TODO: thumbfast
packages.mpv-webm # activate with SHIFT+w
];
#programs.mpv.config.osc = "no"; # likely a 'thumbnail' requirement #programs.mpv.config.osc = "no"; # likely a 'thumbnail' requirement
#https://nixos.wiki/wiki/Accelerated_Video_Playback #https://nixos.wiki/wiki/Accelerated_Video_Playback