diff --git a/codecs/mozjpeg/flake.nix b/codecs/mozjpeg/flake.nix index 91f0fb214..becae240c 100644 --- a/codecs/mozjpeg/flake.nix +++ b/codecs/mozjpeg/flake.nix @@ -20,18 +20,21 @@ pkgs = nixpkgs.legacyPackages.${system}; inherit (pkgs) callPackage stdenv lib; - buildSquooshCppCodec = callPackage (import ../../nix/squoosh-cxx-builder) {}; - squooshHelpers = callPackage (import ../../nix/squoosh-helpers) {}; + buildSquooshCppCodec = callPackage (import ../../nix/squoosh-cxx-builder) { }; + squooshHelpers = callPackage (import ../../nix/squoosh-helpers) { }; inherit (squooshHelpers) mkInstallable forAllVariants; variants = { - base = {}; + base = { }; }; builder = variantName: opts: { mozjpeg-squoosh = buildSquooshCppCodec { name = "mozjpeg-squoosh"; - src = lib.sources.sourceByRegex ./. ["Makefile" "enc(/.+)?"]; + src = lib.sources.sourceByRegex ./. [ + "Makefile" + "enc(/.+)?" + ]; MOZJPEG = self.packages.${system}."mozjpeg-${variantName}"; dontConfigure = true; @@ -73,13 +76,15 @@ ''; dontFixup = true; }; - }; + }; - packageVariants = forAllVariants {inherit builder variants;}; + packageVariants = forAllVariants { inherit builder variants; }; in mkInstallable { - packages = packageVariants // {default = packageVariants."mozjpeg-squoosh-base";}; + packages = packageVariants // { + default = packageVariants."mozjpeg-squoosh-base"; + }; } ); } diff --git a/codecs/resize/flake.nix b/codecs/resize/flake.nix index 90efea825..92b06b7cf 100644 --- a/codecs/resize/flake.nix +++ b/codecs/resize/flake.nix @@ -17,10 +17,15 @@ pkgs = nixpkgs.legacyPackages.${system}; inherit (pkgs) callPackage lib; - buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};}; - mkInstallable = callPackage (import ../../nix/mk-installable) {}; + buildSquooshRustCodec = callPackage (import ../../nix/squoosh-rust-builder) { + fenix = fenix.packages.${system}; + }; + mkInstallable = callPackage (import ../../nix/mk-installable) { }; - src = lib.sources.sourceByRegex ./. ["Makefile" "enc(/.+)?"]; + src = lib.sources.sourceByRegex ./. [ + "Makefile" + "enc(/.+)?" + ]; in mkInstallable { packages = rec { diff --git a/codecs/rotate/flake.nix b/codecs/rotate/flake.nix index d61d947c0..00bb644e1 100644 --- a/codecs/rotate/flake.nix +++ b/codecs/rotate/flake.nix @@ -1,4 +1,3 @@ - { inputs = { nixpkgs.url = "github:nixos/nixpkgs/24.05"; @@ -10,18 +9,23 @@ self, nixpkgs, flake-utils, - fenix + fenix, }: flake-utils.lib.eachDefaultSystem ( system: let pkgs = nixpkgs.legacyPackages.${system}; inherit (pkgs) callPackage lib; - - buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};}; - mkInstallable = callPackage (import ../../nix/mk-installable) {}; - src = lib.sources.sourceByRegex ./. ["Cargo\.*" ".*\.rs"]; + buildSquooshRustCodec = callPackage (import ../../nix/squoosh-rust-builder) { + fenix = fenix.packages.${system}; + }; + mkInstallable = callPackage (import ../../nix/mk-installable) { }; + + src = lib.sources.sourceByRegex ./. [ + "Cargo\.*" + ".*\.rs" + ]; in mkInstallable { packages = rec { diff --git a/codecs/webp/flake.nix b/codecs/webp/flake.nix index e9f196514..74d917ad1 100644 --- a/codecs/webp/flake.nix +++ b/codecs/webp/flake.nix @@ -19,18 +19,18 @@ let pkgs = nixpkgs.legacyPackages.${system}; inherit (pkgs) lib stdenv callPackage; - buildSquooshCppCodec = callPackage (import ../../nix/squoosh-cxx-builder) {}; - squooshHelpers = callPackage (import ../../nix/squoosh-helpers) {}; + buildSquooshCppCodec = callPackage (import ../../nix/squoosh-cxx-builder) { }; + squooshHelpers = callPackage (import ../../nix/squoosh-helpers) { }; inherit (squooshHelpers) mkInstallable forAllVariants; - variants = { - base = { - simd = false; - }; - simd = { - simd = true; + variants = { + base = { + simd = false; + }; + simd = { + simd = true; + }; }; - }; builder = variantName: @@ -38,7 +38,11 @@ { "webp-squoosh" = buildSquooshCppCodec { name = "webp-squoosh-${variantName}"; - src = lib.sources.sourceByRegex ./. ["Makefile" "enc(/.+)?" "dec(/.+)?"]; + src = lib.sources.sourceByRegex ./. [ + "Makefile" + "enc(/.+)?" + "dec(/.+)?" + ]; nativeBuildInputs = [ pkgs.emscripten self.packages.${system}."webp-${variantName}" @@ -95,25 +99,30 @@ }; }; - packageVariants = forAllVariants { - inherit builder variants; - }; + packageVariants = forAllVariants { inherit builder variants; }; - defaultPackage = let - copyAllCodecs = lib.concatLines (lib.mapAttrsToList (name: _: "cp -r ${packageVariants."webp-squoosh-${name}"} $out/${name}") variants); - in - stdenv.mkDerivation { - name = "all-variants"; - phases = ["buildPhase"]; - buildPhase = '' - mkdir -p $out; - ${copyAllCodecs} - ''; - }; + defaultPackage = + let + copyAllCodecs = lib.concatLines ( + lib.mapAttrsToList ( + name: _: "cp -r ${packageVariants."webp-squoosh-${name}"} $out/${name}" + ) variants + ); + in + stdenv.mkDerivation { + name = "all-variants"; + phases = [ "buildPhase" ]; + buildPhase = '' + mkdir -p $out; + ${copyAllCodecs} + ''; + }; in mkInstallable { - packages = packageVariants // {default = defaultPackage;}; + packages = packageVariants // { + default = defaultPackage; + }; } ); }