Compare commits
No commits in common. "753d780ca63f60d8bbd5061a8ac6b38d0e6242f9" and "d0e3c99c12178dac39243d9053ddd79c4cdd39c4" have entirely different histories.
753d780ca6
...
d0e3c99c12
35
flake.nix
35
flake.nix
|
@ -6,8 +6,8 @@
|
|||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils }: let
|
||||
packages = utils.lib.eachDefaultSystem (system: let
|
||||
outputs = { self, nixpkgs, utils }: 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 {
|
||||
packages.sub-select = mpvScript {
|
||||
in rec {
|
||||
packages.mpvScripts.sub-select = mpvScript {
|
||||
owner = "CogentRedTester";
|
||||
repo = "mpv-sub-select";
|
||||
rev = "5d2fb7ab73fc0e36d44109e75c9be26bd42084e2";
|
||||
|
@ -30,32 +30,30 @@
|
|||
scriptName = "sub-select.lua";
|
||||
};
|
||||
|
||||
packages.segment-linking = mpvScript {
|
||||
packages.mpvScripts.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 = { pkgs, lib, ... }: {
|
||||
nixpkgs.overlays = [ overlays.default ];
|
||||
nixosModules.default = { ... }: {
|
||||
nixpkgs.overlays = final: prev: {
|
||||
mpv = prev.mpv.override {
|
||||
scripts = with packages.mpvScripts; [
|
||||
sub-select
|
||||
segment-linking
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# needed for mpv segment-linking plugin
|
||||
environment.systemPackages = [
|
||||
pkgs.mkvtoolnix
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [ ({ config, ... }: {
|
||||
home-manager.sharedModules = [ ({ config, lib, ... }: {
|
||||
config = lib.mkIf config.programs.mpv.enable {
|
||||
xdg.configFile."mpv/script-opts/sub-select.json".text = builtins.toJSON [
|
||||
{
|
||||
|
@ -95,5 +93,6 @@
|
|||
};
|
||||
}) ];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue