1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-15 00:54:46 +00:00
nixpkgs/pkgs/data/misc/mailcap/default.nix
Milan Pässler ff0148d868 nixos/nginx: use mailcap mime.types
The mime type definitions included with nginx are very incomplete, so
we use a list of mime types from the mailcap package, which is also
used by most other Linux distributions by default.
2019-10-09 14:20:40 +00:00

31 lines
888 B
Nix

{ lib, fetchzip }:
let
version = "2.1.48";
in fetchzip {
name = "mailcap-${version}";
url = "https://releases.pagure.org/mailcap/mailcap-${version}.tar.xz";
sha256 = "08d0avz8971hkggd60dk9yyd14izz24yag3prpfafbvm670jlmqg";
postFetch = ''
tar -xavf $downloadedFile --strip-components=1
substituteInPlace mailcap --replace "/usr/bin/" ""
gzip mailcap.4
sh generate-nginx-mimetypes.sh < mime.types > nginx-mime.types
install -D -m0644 nginx-mime.types $out/etc/nginx/mime.types
install -D -m0644 -t $out/etc mailcap mime.types
install -D -m0644 -t $out/share/man/man4 mailcap.4.gz
'';
meta = with lib; {
description = "Helper application and MIME type associations for file types";
homepage = "https://pagure.io/mailcap";
license = licenses.mit;
maintainers = with maintainers; [ c0bw3b ];
platforms = platforms.all;
};
}