mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	add nix support
This commit is contained in:
		| @@ -1393,6 +1393,11 @@ Nimrod: | |||||||
|   - .nim |   - .nim | ||||||
|   - .nimrod |   - .nimrod | ||||||
|  |  | ||||||
|  | Nix: | ||||||
|  |   type: programming | ||||||
|  |   extensions: | ||||||
|  |   - .nix | ||||||
|  |  | ||||||
| Nu: | Nu: | ||||||
|   type: programming |   type: programming | ||||||
|   lexer: Scheme |   lexer: Scheme | ||||||
|   | |||||||
| @@ -358,6 +358,9 @@ | |||||||
|     "Nimrod": [ |     "Nimrod": [ | ||||||
|       ".nim" |       ".nim" | ||||||
|     ], |     ], | ||||||
|  |     "Nix": [ | ||||||
|  |       ".nix" | ||||||
|  |     ], | ||||||
|     "NSIS": [ |     "NSIS": [ | ||||||
|       ".nsh", |       ".nsh", | ||||||
|       ".nsi" |       ".nsi" | ||||||
| @@ -747,8 +750,8 @@ | |||||||
|       ".gemrc" |       ".gemrc" | ||||||
|     ] |     ] | ||||||
|   }, |   }, | ||||||
|   "tokens_total": 636184, |   "tokens_total": 636372, | ||||||
|   "languages_total": 816, |   "languages_total": 817, | ||||||
|   "tokens": { |   "tokens": { | ||||||
|     "ABAP": { |     "ABAP": { | ||||||
|       "*/**": 1, |       "*/**": 1, | ||||||
| @@ -44758,6 +44761,72 @@ | |||||||
|     "Nimrod": { |     "Nimrod": { | ||||||
|       "echo": 1 |       "echo": 1 | ||||||
|     }, |     }, | ||||||
|  |     "Nix": { | ||||||
|  |       "{": 8, | ||||||
|  |       "stdenv": 1, | ||||||
|  |       "fetchurl": 2, | ||||||
|  |       "fetchgit": 5, | ||||||
|  |       "openssl": 2, | ||||||
|  |       "zlib": 2, | ||||||
|  |       "pcre": 2, | ||||||
|  |       "libxml2": 2, | ||||||
|  |       "libxslt": 2, | ||||||
|  |       "expat": 2, | ||||||
|  |       "rtmp": 4, | ||||||
|  |       "false": 4, | ||||||
|  |       "fullWebDAV": 3, | ||||||
|  |       "syslog": 4, | ||||||
|  |       "moreheaders": 3, | ||||||
|  |       "...": 1, | ||||||
|  |       "}": 8, | ||||||
|  |       "let": 1, | ||||||
|  |       "version": 2, | ||||||
|  |       ";": 32, | ||||||
|  |       "mainSrc": 2, | ||||||
|  |       "url": 5, | ||||||
|  |       "sha256": 5, | ||||||
|  |       "-": 12, | ||||||
|  |       "ext": 5, | ||||||
|  |       "git": 2, | ||||||
|  |       "//github.com/arut/nginx": 2, | ||||||
|  |       "module.git": 3, | ||||||
|  |       "rev": 4, | ||||||
|  |       "dav": 2, | ||||||
|  |       "https": 2, | ||||||
|  |       "//github.com/yaoweibin/nginx_syslog_patch.git": 1, | ||||||
|  |       "//github.com/agentzh/headers": 1, | ||||||
|  |       "more": 1, | ||||||
|  |       "nginx": 1, | ||||||
|  |       "in": 1, | ||||||
|  |       "stdenv.mkDerivation": 1, | ||||||
|  |       "rec": 1, | ||||||
|  |       "name": 1, | ||||||
|  |       "src": 1, | ||||||
|  |       "buildInputs": 1, | ||||||
|  |       "[": 5, | ||||||
|  |       "]": 5, | ||||||
|  |       "+": 10, | ||||||
|  |       "stdenv.lib.optional": 5, | ||||||
|  |       "patches": 1, | ||||||
|  |       "if": 1, | ||||||
|  |       "then": 1, | ||||||
|  |       "else": 1, | ||||||
|  |       "configureFlags": 1, | ||||||
|  |       "preConfigure": 1, | ||||||
|  |       "export": 1, | ||||||
|  |       "NIX_CFLAGS_COMPILE": 1, | ||||||
|  |       "postInstall": 1, | ||||||
|  |       "mv": 1, | ||||||
|  |       "out/sbin": 1, | ||||||
|  |       "out/bin": 1, | ||||||
|  |       "meta": 1, | ||||||
|  |       "description": 1, | ||||||
|  |       "maintainers": 1, | ||||||
|  |       "stdenv.lib.maintainers.raskin": 1, | ||||||
|  |       "platforms": 1, | ||||||
|  |       "stdenv.lib.platforms.all": 1, | ||||||
|  |       "inherit": 1 | ||||||
|  |     }, | ||||||
|     "NSIS": { |     "NSIS": { | ||||||
|       ";": 39, |       ";": 39, | ||||||
|       "bigtest.nsi": 1, |       "bigtest.nsi": 1, | ||||||
| @@ -68427,6 +68496,7 @@ | |||||||
|     "NetLogo": 243, |     "NetLogo": 243, | ||||||
|     "Nginx": 179, |     "Nginx": 179, | ||||||
|     "Nimrod": 1, |     "Nimrod": 1, | ||||||
|  |     "Nix": 188, | ||||||
|     "NSIS": 725, |     "NSIS": 725, | ||||||
|     "Nu": 116, |     "Nu": 116, | ||||||
|     "Objective-C": 26518, |     "Objective-C": 26518, | ||||||
| @@ -68619,6 +68689,7 @@ | |||||||
|     "NetLogo": 1, |     "NetLogo": 1, | ||||||
|     "Nginx": 1, |     "Nginx": 1, | ||||||
|     "Nimrod": 1, |     "Nimrod": 1, | ||||||
|  |     "Nix": 1, | ||||||
|     "NSIS": 2, |     "NSIS": 2, | ||||||
|     "Nu": 2, |     "Nu": 2, | ||||||
|     "Objective-C": 19, |     "Objective-C": 19, | ||||||
| @@ -68706,5 +68777,5 @@ | |||||||
|     "Zephir": 2, |     "Zephir": 2, | ||||||
|     "Zimpl": 1 |     "Zimpl": 1 | ||||||
|   }, |   }, | ||||||
|   "md5": "7403e3e21c597d10462391ab49bb9bf9" |   "md5": "125a0720c61fe35eff545b8a03732d30" | ||||||
| } | } | ||||||
							
								
								
									
										80
									
								
								samples/Nix/nginx.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										80
									
								
								samples/Nix/nginx.nix
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,80 @@ | |||||||
|  | { stdenv, fetchurl, fetchgit, openssl, zlib, pcre, libxml2, libxslt, expat | ||||||
|  | , rtmp ? false | ||||||
|  | , fullWebDAV ? false | ||||||
|  | , syslog ? false | ||||||
|  | , moreheaders ? false, ...}: | ||||||
|  |  | ||||||
|  | let | ||||||
|  |   version = "1.4.4"; | ||||||
|  |   mainSrc = fetchurl { | ||||||
|  |     url = "http://nginx.org/download/nginx-${version}.tar.gz"; | ||||||
|  |     sha256 = "1f82845mpgmhvm151fhn2cnqjggw9w7cvsqbva9rb320wmc9m63w"; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   rtmp-ext = fetchgit { | ||||||
|  |     url = git://github.com/arut/nginx-rtmp-module.git; | ||||||
|  |     rev = "1cfb7aeb582789f3b15a03da5b662d1811e2a3f1"; | ||||||
|  |     sha256 = "03ikfd2l8mzsjwx896l07rdrw5jn7jjfdiyl572yb9jfrnk48fwi"; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   dav-ext = fetchgit { | ||||||
|  |     url = git://github.com/arut/nginx-dav-ext-module.git; | ||||||
|  |     rev = "54cebc1f21fc13391aae692c6cce672fa7986f9d"; | ||||||
|  |     sha256 = "1dvpq1fg5rslnl05z8jc39sgnvh3akam9qxfl033akpczq1bh8nq"; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   syslog-ext = fetchgit { | ||||||
|  |     url = https://github.com/yaoweibin/nginx_syslog_patch.git; | ||||||
|  |     rev = "165affd9741f0e30c4c8225da5e487d33832aca3"; | ||||||
|  |     sha256 = "14dkkafjnbapp6jnvrjg9ip46j00cr8pqc2g7374z9aj7hrvdvhs"; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   moreheaders-ext = fetchgit { | ||||||
|  |     url = https://github.com/agentzh/headers-more-nginx-module.git; | ||||||
|  |     rev = "refs/tags/v0.23"; | ||||||
|  |     sha256 = "12pbjgsxnvcf2ff2i2qdn39q4cm5czlgrng96j8ml4cgxvnbdh39"; | ||||||
|  |   }; | ||||||
|  | in | ||||||
|  |  | ||||||
|  | stdenv.mkDerivation rec { | ||||||
|  |   name = "nginx-${version}"; | ||||||
|  |   src = mainSrc; | ||||||
|  |  | ||||||
|  |   buildInputs = [ openssl zlib pcre libxml2 libxslt | ||||||
|  |     ] ++ stdenv.lib.optional fullWebDAV expat; | ||||||
|  |  | ||||||
|  |   patches = if syslog then [ "${syslog-ext}/syslog_1.4.0.patch" ] else []; | ||||||
|  |  | ||||||
|  |   configureFlags = [ | ||||||
|  |     "--with-http_ssl_module" | ||||||
|  |     "--with-http_spdy_module" | ||||||
|  |     "--with-http_xslt_module" | ||||||
|  |     "--with-http_sub_module" | ||||||
|  |     "--with-http_dav_module" | ||||||
|  |     "--with-http_gzip_static_module" | ||||||
|  |     "--with-http_secure_link_module" | ||||||
|  |     "--with-ipv6" | ||||||
|  |     # Install destination problems | ||||||
|  |     # "--with-http_perl_module" | ||||||
|  |   ] ++ stdenv.lib.optional rtmp "--add-module=${rtmp-ext}" | ||||||
|  |     ++ stdenv.lib.optional fullWebDAV "--add-module=${dav-ext}" | ||||||
|  |     ++ stdenv.lib.optional syslog "--add-module=${syslog-ext}" | ||||||
|  |     ++ stdenv.lib.optional moreheaders "--add-module=${moreheaders-ext}"; | ||||||
|  |  | ||||||
|  |   preConfigure = '' | ||||||
|  |     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2 }/include/libxml2" | ||||||
|  |   ''; | ||||||
|  |  | ||||||
|  |   # escape example | ||||||
|  |   postInstall = '' | ||||||
|  |     mv $out/sbin $out/bin ''' ''${ | ||||||
|  |    ${ if true then ${ "" } else false } | ||||||
|  |   ''; | ||||||
|  |  | ||||||
|  |   meta = { | ||||||
|  |     description = "A reverse proxy and lightweight webserver"; | ||||||
|  |     maintainers = [ stdenv.lib.maintainers.raskin]; | ||||||
|  |     platforms = stdenv.lib.platforms.all; | ||||||
|  |     inherit version; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user