Consume buildHaskell functions
Use the newly defined `buildHaskell` function for a few of my existing Haskell projects. So far, it works as intended!
This commit is contained in:
		
							parent
							
								
									4ea55dd013
								
							
						
					
					
						commit
						2da4b12266
					
				
					 3 changed files with 45 additions and 57 deletions
				
			
		|  | @ -1,26 +1,16 @@ | |||
| let | ||||
|   pkgs = import (builtins.fetchGit { | ||||
|     url = "https://github.com/NixOS/nixpkgs-channels"; | ||||
|     ref = "nixos-20.03"; | ||||
|     rev = "afa9ca61924f05aacfe495a7ad0fd84709d236cc"; | ||||
|   }) {}; | ||||
| 
 | ||||
|   ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [ | ||||
|     optparse-applicative | ||||
|     unordered-containers | ||||
|     split | ||||
|   ]); | ||||
| in pkgs.stdenv.mkDerivation { | ||||
|   briefcase = import /home/wpcarro/briefcase {}; | ||||
| in briefcase.buildHaskell.program { | ||||
|   name = "transform-keyboard"; | ||||
|   buildInputs = []; | ||||
|   src = builtins.path { | ||||
|   srcs = builtins.path { | ||||
|     path = ./.; | ||||
|     name = "transform-keyboard-src"; | ||||
|   }; | ||||
|   buildPhase = '' | ||||
|     ${ghc}/bin/ghc ./Main.hs | ||||
|   ''; | ||||
|   installPhase = '' | ||||
|     mkdir -p $out && mv Main $out/transform-keyboard | ||||
|   ''; | ||||
|   deps = hpkgs: with hpkgs; [ | ||||
|     optparse-applicative | ||||
|     unordered-containers | ||||
|     split | ||||
|     rio | ||||
|   ]; | ||||
|   ghcExtensions = []; | ||||
| } | ||||
|  |  | |||
|  | @ -1,27 +1,27 @@ | |||
| let | ||||
|   pkgs = import /home/wpcarro/nixpkgs {}; | ||||
|   ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: [ | ||||
|     hpkgs.servant-server | ||||
|     hpkgs.aeson | ||||
|     hpkgs.wai-cors | ||||
|     hpkgs.warp | ||||
|     hpkgs.jwt | ||||
|     hpkgs.unordered-containers | ||||
|     hpkgs.base64 | ||||
|     hpkgs.http-conduit | ||||
|     hpkgs.rio | ||||
|   ]); | ||||
| in pkgs.stdenv.mkDerivation { | ||||
|   name = "LearnPianoChords-server"; | ||||
|   briefcase = import /home/wpcarro/briefcase {}; | ||||
| in briefcase.buildHaskell.program { | ||||
|   name = "server"; | ||||
|   srcs = builtins.path { | ||||
|     path = ./.; | ||||
|     name = "LearnPianoChords-server-src"; | ||||
|   }; | ||||
|   buildPhase = '' | ||||
|     ${ghc} -O Main.hs \ | ||||
|       -XOverloadedStrings \ | ||||
|       -XNoImplicitPrelude \ | ||||
|       -XRecordWildCards \ | ||||
|       -XTypeApplications | ||||
|   ''; | ||||
|   ghcExtensions = [ | ||||
|     "OverloadedStrings" | ||||
|     "NoImplicitPrelude" | ||||
|     "RecordWildCards" | ||||
|     "TypeApplications" | ||||
|   ]; | ||||
|   deps = hpkgs: with hpkgs; [ | ||||
|     servant-server | ||||
|     aeson | ||||
|     wai-cors | ||||
|     warp | ||||
|     jwt | ||||
|     unordered-containers | ||||
|     base64 | ||||
|     http-conduit | ||||
|     rio | ||||
|     envy | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
|  | @ -1,19 +1,17 @@ | |||
| let | ||||
|   pkgs = import /home/wpcarro/nixpkgs {}; | ||||
| in pkgs.mkShell { | ||||
|   buildInputs = with pkgs; [ | ||||
|     (haskellPackages.ghcWithPackages (hpkgs: [ | ||||
|       hpkgs.hspec | ||||
|       hpkgs.servant-server | ||||
|       hpkgs.aeson | ||||
|       hpkgs.wai-cors | ||||
|       hpkgs.warp | ||||
|       hpkgs.jwt | ||||
|       hpkgs.unordered-containers | ||||
|       hpkgs.base64 | ||||
|       hpkgs.http-conduit | ||||
|       hpkgs.rio | ||||
|       hpkgs.envy | ||||
|     ])) | ||||
|   briefcase = import /home/wpcarro/briefcase {}; | ||||
| in briefcase.buildHaskell.shell { | ||||
|   deps = hpkgs: with hpkgs; [ | ||||
|     hspec | ||||
|     servant-server | ||||
|     aeson | ||||
|     wai-cors | ||||
|     warp | ||||
|     jwt | ||||
|     unordered-containers | ||||
|     base64 | ||||
|     http-conduit | ||||
|     rio | ||||
|     envy | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue