1{ lib, fetchzip }:
2
3let
4 version = "2.1.48";
5
6in fetchzip {
7 name = "mailcap-${version}";
8
9 url = "https://releases.pagure.org/mailcap/mailcap-${version}.tar.xz";
10 sha256 = "08d0avz8971hkggd60dk9yyd14izz24yag3prpfafbvm670jlmqg";
11
12 postFetch = ''
13 tar -xavf $downloadedFile --strip-components=1
14 substituteInPlace mailcap --replace "/usr/bin/" ""
15 gzip mailcap.4
16 sh generate-nginx-mimetypes.sh < mime.types > nginx-mime.types
17
18 install -D -m0644 nginx-mime.types $out/etc/nginx/mime.types
19 install -D -m0644 -t $out/etc mailcap mime.types
20 install -D -m0644 -t $out/share/man/man4 mailcap.4.gz
21 '';
22
23 meta = with lib; {
24 description = "Helper application and MIME type associations for file types";
25 homepage = "https://pagure.io/mailcap";
26 license = licenses.mit;
27 maintainers = with maintainers; [ c0bw3b ];
28 platforms = platforms.all;
29 };
30}