15 stdenv.mkDerivation rec {
20 url = "https://releases.pagure.org/mailcap/mailcap-${version}.tar.xz";
21 hash = "sha256-mkAyIC/A0rCFj0GxZzianP5SrCTsKC5kebkHZTGd4RM=";
27 substituteInPlace mailcap --replace "/usr/bin/" ""
28 sh generate-nginx-mimetypes.sh < mime.types > nginx-mime.types
30 install -D -m0644 nginx-mime.types $out/etc/nginx/mime.types
31 install -D -m0644 -t $out/etc mailcap mime.types
32 install -D -m0644 -t $out/share/man/man5 mailcap.5
37 passthru.updateScript = writeScript "update-mailcap" ''
38 export PATH=${lib.makeBinPath [ git coreutils gawk gnused nix-update ]}:$PATH
39 VERSION="$(git ls-remote --tags --sort="v:refname" https://pagure.io/mailcap.git | \
40 awk '{ print $2 }' | \
41 grep "refs/tags/r" | \
42 sed -E -e "s,refs/tags/r(.*)$,\1," -e "s/-/./g" | \
43 sort --version-sort --reverse | \
45 exec nix-update --version "$VERSION" "$@"
48 passthru.tests.nginx-mime = nixosTests.nginx-mime;
51 description = "Helper application and MIME type associations for file types";
52 homepage = "https://pagure.io/mailcap";
53 license = licenses.mit;
54 maintainers = with maintainers; [ c0bw3b ];
55 platforms = platforms.all;