elm2nix 0.1.0 → 0.1.1
raw patch · 4 files changed
+34/−8 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +6/−0
- README.md +16/−6
- elm2nix.cabal +1/−1
- src/Elm2Nix/PackagesSnapshot.hs +11/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ # Changelog for elm2nix +## 0.1.1 (2019-02-19)++### Changes++- #22 Support req-0.1.0.0 (@domenkozar)+ ## 0.1.0 (2018-12-28) - Initial release (@domenkozar)
README.md view
@@ -1,6 +1,6 @@ # elm2nix -[](https://travis-ci.org/domenkozar/elm2nix)+[](https://travis-ci.org/hercules-ci/elm2nix) [](https://hackage.haskell.org/package/elm2nix) Convert an [Elm](http://elm-lang.org/) project into@@ -18,17 +18,27 @@ ## Installation - $ nix-shell -p stack --run "stack install --nix"+### From nixpkgs (recommended) +Make sure you have up to date stable or unstable nixpkgs channel.++ $ nix-env -iA elm2nix++### From source++ $ git clone https://github.com/domenkozar/elm2nix.git+ $ cd elm2nix+ $ nix-env -if .+ ## Usage $ git clone https://github.com/evancz/elm-todomvc.git $ cd elm-todomvc- $ ~/.local/bin/elm2nix init > default.nix- $ ~/.local/bin/elm2nix convert > elm-srcs.nix- $ ~/.local/bin/elm2nix snapshot > versions.dat+ $ elm2nix init > default.nix+ $ elm2nix convert > elm-srcs.nix+ $ elm2nix snapshot > versions.dat $ nix-build- $ chromium ./result/index.html+ $ chromium ./result/Main.html ## Running tests (as per CI)
elm2nix.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: elm2nix-version: 0.1.0+version: 0.1.1 synopsis: Turn your Elm project into buildable Nix project description: Please see the README on Github at <https://github.com/domenkozar/elm2nix#readme> homepage: https://github.com/domenkozar/elm2nix#readme
src/Elm2Nix/PackagesSnapshot.hs view
@@ -8,6 +8,7 @@ -} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-} module Elm2Nix.PackagesSnapshot ( snapshot ) where@@ -17,7 +18,10 @@ import qualified Data.Binary as Binary import Data.Binary (Binary, put, get, putWord8, getWord8) import qualified Data.Map as Map+#if MIN_VERSION_req(2,0,0)+#else import Data.Default (def)+#endif import Data.Map (Map) import Data.Text (Text) import qualified Data.Text as Text@@ -92,9 +96,15 @@ get = liftM2 PackageRegistry get get put (PackageRegistry a b) = put a >> put b +#if MIN_VERSION_req(2,0,0)+defHttpConfig = Req.defaultHttpConfig+#else+defHttpConfig = def+#endif+ snapshot :: String -> IO () snapshot dir = do- r <- Req.runReq def $+ r <- Req.runReq defHttpConfig $ Req.req Req.POST (Req.https "package.elm-lang.org" Req./: "all-packages")