Files
nixpkgs/pkgs/servers/sql/postgresql/ext/pg_byteamagic.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

51 lines
1.2 KiB
Nix

{
fetchFromGitHub,
file,
lib,
postgresql,
postgresqlBuildExtension,
postgresqlTestExtension,
}:
postgresqlBuildExtension (finalAttrs: {
pname = "pg_byteamagic";
version = "0.2.4";
src = fetchFromGitHub {
owner = "nmandery";
repo = "pg_byteamagic";
tag = "v${finalAttrs.version}";
hash = "sha256-0RRElMMVUm3cXLI7G3SkIVr8yA/Rk3gBsgXG+EFU3CI=";
};
buildInputs = [
file
];
passthru.tests = {
extension = postgresqlTestExtension {
inherit (finalAttrs) finalPackage;
sql = ''
CREATE EXTENSION byteamagic;
SELECT byteamagic_mime('test');
'';
asserts = [
{
query = "SELECT byteamagic_mime('test')";
expected = "'text/plain'";
description = "`byteamagic_mime(...) should return proper mimetype.";
}
];
};
};
meta = {
description = "PostgreSQL extension to determinate the filetypes of bytea BLOBs";
homepage = "https://github.com/nmandery/pg_byteamagic";
changelog = "https://raw.githubusercontent.com/nmandery/pg_byteamagic/refs/tags/v${finalAttrs.version}/Changes";
license = lib.licenses.bsd2WithViews;
teams = [ lib.teams.apm ];
platforms = postgresql.meta.platforms;
};
})