Format everything

This commit is contained in:
Surma
2024-09-08 13:18:41 +01:00
parent d895e0a6b6
commit 8a1c95b7dc
4 changed files with 64 additions and 41 deletions

View File

@@ -31,7 +31,10 @@
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;
@@ -79,7 +82,9 @@
in
mkInstallable {
packages = packageVariants // {default = packageVariants."mozjpeg-squoosh-base";};
packages = packageVariants // {
default = packageVariants."mozjpeg-squoosh-base";
};
}
);
}

View File

@@ -17,10 +17,15 @@
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) callPackage lib;
buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};};
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 {

View File

@@ -1,4 +1,3 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/24.05";
@@ -10,7 +9,7 @@
self,
nixpkgs,
flake-utils,
fenix
fenix,
}:
flake-utils.lib.eachDefaultSystem (
system:
@@ -18,10 +17,15 @@
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) callPackage lib;
buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};};
buildSquooshRustCodec = callPackage (import ../../nix/squoosh-rust-builder) {
fenix = fenix.packages.${system};
};
mkInstallable = callPackage (import ../../nix/mk-installable) { };
src = lib.sources.sourceByRegex ./. ["Cargo\.*" ".*\.rs"];
src = lib.sources.sourceByRegex ./. [
"Cargo\.*"
".*\.rs"
];
in
mkInstallable {
packages = rec {

View File

@@ -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,12 +99,15 @@
};
};
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);
defaultPackage =
let
copyAllCodecs = lib.concatLines (
lib.mapAttrsToList (
name: _: "cp -r ${packageVariants."webp-squoosh-${name}"} $out/${name}"
) variants
);
in
stdenv.mkDerivation {
name = "all-variants";
@@ -113,7 +120,9 @@
in
mkInstallable {
packages = packageVariants // {default = defaultPackage;};
packages = packageVariants // {
default = defaultPackage;
};
}
);
}