diff --git a/flake.nix b/flake.nix index c1f20d12..1025d2f0 100644 --- a/flake.nix +++ b/flake.nix @@ -87,9 +87,6 @@ # The order here is important(?). overlays = [ - # Put my custom packages to be available. - self.overlays.default - (final: prev: { inherit (inputs.firefox-addons.lib.${defaultSystem}) buildFirefoxXpiAddon; firefox-addons = final.callPackage ./pkgs/firefox-addons { }; @@ -103,7 +100,7 @@ # Access to NUR. inputs.nur.overlay - ]; + ] ++ (lib'.attrValues self.overlays); defaultSystem = "x86_64-linux"; @@ -385,7 +382,9 @@ lib'.importModules (lib'.filesToAttr ./modules/home-manager); # In case somebody wants to use my stuff to be included in nixpkgs. - overlays.default = final: prev: import ./pkgs { pkgs = prev; }; + overlays = import ./overlays // { + default = final: prev: import ./pkgs { pkgs = prev; }; + }; # My custom packages, available in here as well. Though, I mainly support # "x86_64-linux". I just want to try out supporting other systems. diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..63cef0c7 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,7 @@ +# A bunch of custom overlays. This is more suitable for larger and more +# established packages that needed extensive customization. Take note each of +# the values in the attribute set is a separate overlay function so you'll +# simply have to append them as a list (i.e., `lib.attrValues`). +{ + ffmpeg-foodogsquared = import ./ffmpeg-foodogsquared; +} diff --git a/overlays/ffmpeg-foodogsquared/add-custom-filters.patch b/overlays/ffmpeg-foodogsquared/add-custom-filters.patch new file mode 100644 index 00000000..b1323546 --- /dev/null +++ b/overlays/ffmpeg-foodogsquared/add-custom-filters.patch @@ -0,0 +1,26 @@ +diff --git a/libavfilter/Makefile b/libavfilter/Makefile +index a90ca30ad7..c0fc73be46 100644 +--- a/libavfilter/Makefile ++++ b/libavfilter/Makefile +@@ -367,6 +367,7 @@ OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o + OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o + OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o + OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o ++OBJS-$(CONFIG_GLTRANSITION_FILTER) += vf_gltransition.o ++OBJS-$(CONFIG_SHADERTOY_FILTER) += vf_shadertoy.o + + OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o + OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o +diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c +index 6eac828616..0570c1c2aa 100644 +--- a/libavfilter/allfilters.c ++++ b/libavfilter/allfilters.c +@@ -357,6 +357,7 @@ extern AVFilter ff_vf_yadif; + extern const AVFilter ff_vf_zmq; + extern const AVFilter ff_vf_zoompan; + extern const AVFilter ff_vf_zscale; ++extern const AVFilter ff_vf_gltransition; ++extern const AVFilter ff_vf_shadertoy; + + extern const AVFilter ff_vsrc_allrgb; + extern const AVFilter ff_vsrc_allyuv; diff --git a/overlays/ffmpeg-foodogsquared/default.nix b/overlays/ffmpeg-foodogsquared/default.nix new file mode 100644 index 00000000..8ed6e7c0 --- /dev/null +++ b/overlays/ffmpeg-foodogsquared/default.nix @@ -0,0 +1,29 @@ +final: prev: + +let + ffmpegGLTransitions = prev.fetchFromGitHub { + owner = "transitive-bullshit"; + repo = "ffmpeg-gl-transition"; + rev = "3639b521aafb30b185de281f94560f298a22d420"; + hash = ""; + }; + + ffmpegShadertoyFilter = prev.fetchFromGitLab { + owner = "kriwkrow"; + repo = "ffmpeg_shadertoy_filter"; + rev = "eb297df10a104cae2d4ef3f70188d1e84f104532"; + hash = ""; + }; +in +{ + ffmpeg-foodogsquared = prev.ffmpeg-full.overrideAttrs (finalAttrs: prevAttrs: { + pname = "ffmpeg-foodogsquared"; + patches = prevAttrs.patches ++ [ + ./add-custom-filters.patch + ]; + postPatch = prevAttrs.postPatch + '' + cp ${ffmpegGLTransitions}/vf_gltransition.c $src/libavfilter + cp ${ffmpegShadertoyFilter}/vf_shadertoy.c $src/libavfilter + ''; + }); +}