Compare commits

..

No commits in common. "753d780ca63f60d8bbd5061a8ac6b38d0e6242f9" and "d0e3c99c12178dac39243d9053ddd79c4cdd39c4" have entirely different histories.

View file

@ -6,8 +6,8 @@
utils.url = "github:numtide/flake-utils"; utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, utils }: let outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
packages = utils.lib.eachDefaultSystem (system: let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
mpvScript = { owner, repo, rev, sha256, scriptName }: pkgs.stdenvNoCC.mkDerivation { mpvScript = { owner, repo, rev, sha256, scriptName }: pkgs.stdenvNoCC.mkDerivation {
pname = repo; pname = repo;
@ -21,8 +21,8 @@
''; '';
passthru = { inherit scriptName; }; passthru = { inherit scriptName; };
}; };
in { in rec {
packages.sub-select = mpvScript { packages.mpvScripts.sub-select = mpvScript {
owner = "CogentRedTester"; owner = "CogentRedTester";
repo = "mpv-sub-select"; repo = "mpv-sub-select";
rev = "5d2fb7ab73fc0e36d44109e75c9be26bd42084e2"; rev = "5d2fb7ab73fc0e36d44109e75c9be26bd42084e2";
@ -30,32 +30,30 @@
scriptName = "sub-select.lua"; scriptName = "sub-select.lua";
}; };
packages.segment-linking = mpvScript { packages.mpvScripts.segment-linking = mpvScript {
owner = "CogentRedTester"; owner = "CogentRedTester";
repo = "mpv-segment-linking"; repo = "mpv-segment-linking";
rev = "bb0fdb7961859df57c64b42d75dbbd60a4024e97"; rev = "bb0fdb7961859df57c64b42d75dbbd60a4024e97";
sha256 = "1ykl24p96wwka4fillrzni6i0xkk4s2l9zg1scqypcbs5w491qsj"; sha256 = "1ykl24p96wwka4fillrzni6i0xkk4s2l9zg1scqypcbs5w491qsj";
scriptName = "segment-linking.lua"; scriptName = "segment-linking.lua";
}; };
});
in
packages // rec {
overlays.default = final: prev: let
newScripts = packages.packages.${prev.system};
in {
mpv = prev.mpv.override { scripts = builtins.attrValues newScripts; };
mpvScripts = prev.mpvScripts // newScripts;
};
nixosModules.default = { pkgs, lib, ... }: { nixosModules.default = { ... }: {
nixpkgs.overlays = [ overlays.default ]; nixpkgs.overlays = final: prev: {
mpv = prev.mpv.override {
scripts = with packages.mpvScripts; [
sub-select
segment-linking
];
};
};
# needed for mpv segment-linking plugin # needed for mpv segment-linking plugin
environment.systemPackages = [ environment.systemPackages = [
pkgs.mkvtoolnix pkgs.mkvtoolnix
]; ];
home-manager.sharedModules = [ ({ config, ... }: { home-manager.sharedModules = [ ({ config, lib, ... }: {
config = lib.mkIf config.programs.mpv.enable { config = lib.mkIf config.programs.mpv.enable {
xdg.configFile."mpv/script-opts/sub-select.json".text = builtins.toJSON [ xdg.configFile."mpv/script-opts/sub-select.json".text = builtins.toJSON [
{ {
@ -95,5 +93,6 @@
}; };
}) ]; }) ];
}; };
}; }
);
} }