nixpkgs/pkgs/by-name/im/imaginary/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

53 lines
1.3 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, fetchpatch
, pkg-config
, vips
}:
buildGoModule rec {
pname = "imaginary";
version = "1.2.4";
src = fetchFromGitHub {
owner = "h2non";
repo = pname;
rev = "v${version}";
hash = "sha256-oEkFoZMaNNJPMisqpIneeLK/sA23gaTWJ4nqtDHkrwA=";
};
patches = [
# add -return-size flag recommend by Nextcloud
# https://github.com/h2non/imaginary/pull/382
(fetchpatch {
name = "return-width-and-height-of-generated-images.patch";
url = "https://github.com/h2non/imaginary/commit/cfbf8d724cd326e835dfcb01e7224397c46037d3.patch";
hash = "sha256-TwZ5WU5g9LXrenpfY52jYsc6KsEt2fjDq7cPz6ILlhA=";
})
];
vendorHash = "sha256-BluY6Fz4yAKJ/A9aFuPPsgQN9N/5yd8g8rDfIZeYz5U=";
buildInputs = [ vips ];
nativeBuildInputs = [ pkg-config ];
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
__darwinAllowLocalNetworking = true;
meta = with lib; {
homepage = "https://fly.io/docs/app-guides/run-a-global-image-service";
changelog = "https://github.com/h2non/${pname}/releases/tag/v${version}";
description = "Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda urandom ];
mainProgram = "imaginary";
};
}