Compare commits

...

3 commits

View file

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