mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 16:57:26 +00:00
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/24.05";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
fenix.url = "github:nix-community/fenix/7bad6c7ff73b784a9c7de9147626c8d5d5072809";
|
|
};
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
fenix,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
inherit (pkgs) callPackage writeShellScriptBin;
|
|
|
|
buildSquooshRustCodec= callPackage (import ../../nix/squoosh-rust-builder) {fenix = fenix.packages.${system};};
|
|
|
|
src = ./.;
|
|
in
|
|
{
|
|
packages = rec {
|
|
default = resize-squoosh;
|
|
resize-squoosh = buildSquooshRustCodec {
|
|
name = "resize-squoosh";
|
|
inherit src;
|
|
cargoLock = {
|
|
lockFile = "${src}/Cargo.lock";
|
|
};
|
|
wasmBindgen = {
|
|
sha256 = "sha256-HTElSB76gqCpDu8S0ZJlfd/S4ftMrbwxFgJM9OXBRz8=";
|
|
};
|
|
};
|
|
|
|
installScript = writeShellScriptBin "install.sh" ''
|
|
${pkgs.coreutils}/bin/mkdir -p wasm_build
|
|
${pkgs.rsync}/bin/rsync --chmod=u+w -r ${self.packages.${system}.resize-squoosh}/* wasm_build/
|
|
'';
|
|
};
|
|
apps = {
|
|
install = {
|
|
type = "app";
|
|
program = "${self.packages.${system}.installScript}/bin/install.sh";
|
|
};
|
|
};
|
|
}
|
|
);
|
|
}
|