diff --git a/README.md b/README.md index a5d7697..6bdb363 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# stack2nix +# stackage2nix -[![Build Status](https://travis-ci.org/4e6/stack2nix.svg?branch=master)](https://travis-ci.org/4e6/stack2nix) +[![Build Status](https://travis-ci.org/4e6/stackage2nix.svg?branch=master)](https://travis-ci.org/4e6/stackage2nix) -`stack2nix` converts a Stack file into a Nix Haskell packages set. +`stackage2nix` converts a Stack file into a Nix Haskell packages set. It creates LTS Stackage packages set, and applies appropriate overrides on top of it. ``` -stack2nix \ +stackage2nix \ --lts-haskell "$LTS_HASKELL_REPO" \ --all-cabal-hashes "$ALL_CABAL_HASHES_REPO" \ . ``` -`stack2nix` has three required arguments: +`stackage2nix` has three required arguments: - `--lts-haskell` - path to [fpco/lts-haskell](https://github.com/fpco/lts-haskell) - `--all-cabal-hashes` - path to [commercialhaskell/all-cabal-hashes](https://github.com/commercialhaskell/all-cabal-hashes) checked out to `hackage` branch - `.` - path to stack.yaml file or directory @@ -32,7 +32,7 @@ nix-build -A Complex projects may require some extra customization. Snippet `override.nix` below shows a minimal example of how to apply additional -overrides on top of Haskell packages set produced by `stack2nix`. +overrides on top of Haskell packages set produced by `stackage2nix`. ``` with import {}; @@ -40,13 +40,13 @@ with pkgs.haskell.lib; let haskellPackages = import ./. {}; in haskellPackages.override { overrides = self: super: { - stack2nix = disableSharedExecutables super.stack2nix; + stackage2nix = disableSharedExecutables super.stackage2nix; }; } ``` ``` -nix-build -A stack2nix override.nix +nix-build -A stackage2nix override.nix ``` For more complex overrides and detailed information on how to work with Haskell packages in Nix, see Nixpkgs manual [User’s Guide to the Haskell Infrastructure](http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure) @@ -54,5 +54,5 @@ For more complex overrides and detailed information on how to work with Haskell ## Examples -For other examples of `stack2nix` usage, see [4e6/stack2nix-examples](https://github.com/4e6/stack2nix-examples) repository. -It verifies `stack2nix` by running it on different public projects. +For other examples of `stackage2nix` usage, see [4e6/stackage2nix-examples](https://github.com/4e6/stackage2nix-examples) repository. +It verifies `stackage2nix` by running it on different public projects. diff --git a/src/Runner.hs b/src/Runner.hs index 63e580b..162e819 100644 --- a/src/Runner.hs +++ b/src/Runner.hs @@ -13,7 +13,7 @@ import Distribution.Package (mkPackageName, pkgName) import Distribution.Text as Text (display) import Language.Nix as Nix import Options.Applicative -import Paths_stack2nix ( version ) +import Paths_stackage2nix ( version ) import Runner.Cli import Stack.Config import Stack.Types diff --git a/src/Runner/Cli.hs b/src/Runner/Cli.hs index 9ad5bd9..6ca017e 100644 --- a/src/Runner/Cli.hs +++ b/src/Runner/Cli.hs @@ -9,7 +9,7 @@ import Distribution.Nixpkgs.Haskell.Stack import Distribution.System as System import qualified Distribution.Text as Text import Options.Applicative as Opts -import Paths_stack2nix ( version ) +import Paths_stackage2nix ( version ) import Stack.Types import System.Environment import System.FilePath @@ -70,7 +70,7 @@ pinfo = info <*> infoOption ("stackage2nix " ++ Text.display version) (long "version" <> help "Show version") <*> options ) ( fullDesc - <> header "stack2nix converts Stack files into build instructions for Nix." ) + <> header "stackage2nix converts Stack files into build instructions for Nix." ) nixpkgsRepository :: Parser FilePath nixpkgsRepository = option str diff --git a/stack2nix-test b/stackage2nix-test similarity index 60% rename from stack2nix-test rename to stackage2nix-test index 268b5df..0b8b325 100755 --- a/stack2nix-test +++ b/stackage2nix-test @@ -2,8 +2,9 @@ set -e -LTS_HASKELL_DIR=${LTS_HASKELL_DIR:-~/lts-haskell} -ALL_CABAL_HASHES_DIR=${ALL_CABAL_HASHES_DIR:-~/all-cabal-hashes} +STACKAGE2NIX_WORK_DIR=${STACKAGE2NIX_WORK_DIR:-$HOME} +LTS_HASKELL_DIR=${LTS_HASKELL_DIR:-$STACKAGE2NIX_WORK_DIR/lts-haskell} +ALL_CABAL_HASHES_DIR=${ALL_CABAL_HASHES_DIR:-$STACKAGE2NIX_WORK_DIR/all-cabal-hashes} if [ ! -d "$LTS_HASKELL_DIR" ]; then git clone --depth 1 https://github.com/fpco/lts-haskell.git "$LTS_HASKELL_DIR" @@ -14,9 +15,9 @@ if [ ! -d "$ALL_CABAL_HASHES_DIR" ]; then fi set -x -stack exec -- stack2nix \ +stack exec -- stackage2nix \ --lts-haskell "$LTS_HASKELL_DIR" \ --all-cabal-hashes "$ALL_CABAL_HASHES_DIR" \ . -nix-build -A stack2nix "$@" +nix-build -A stackage2nix "$@" diff --git a/stack2nix.cabal b/stackage2nix.cabal similarity index 89% rename from stack2nix.cabal rename to stackage2nix.cabal index 8ce4081..ab1d554 100644 --- a/stack2nix.cabal +++ b/stackage2nix.cabal @@ -1,10 +1,11 @@ -name: stack2nix +name: stackage2nix version: 0.2.0 synopsis: Convert Stack files into Nix build instructions. -homepage: https://github.com/4e6/stack2nix#readme +homepage: https://github.com/4e6/stackage2nix#readme license: BSD3 license-file: LICENSE author: Dmitry Bushev + , Benno Fünfstück maintainer: bushevdv@gmail.com category: Distribution, Nix build-type: Simple @@ -27,7 +28,7 @@ library , Stack.Types other-modules: AllCabalHashes , LtsHaskell - , Paths_stack2nix + , Paths_stackage2nix build-depends: base > 4.7 && < 5 , Cabal > 1.24 , QuickCheck @@ -58,12 +59,12 @@ library default-language: Haskell2010 ghc-options: -Wall -funbox-strict-fields -executable stack2nix - hs-source-dirs: stack2nix +executable stackage2nix + hs-source-dirs: stackage2nix main-is: Main.hs ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: base - , stack2nix + , stackage2nix default-language: Haskell2010 test-suite spec @@ -76,7 +77,7 @@ test-suite spec , hspec , pretty , shakespeare - , stack2nix + , stackage2nix , text , yaml default-extensions: OverloadedStrings @@ -88,4 +89,4 @@ test-suite spec source-repository head type: git - location: https://github.com/4e6/stack2nix + location: https://github.com/4e6/stackage2nix diff --git a/stack2nix/Main.hs b/stackage2nix/Main.hs similarity index 100% rename from stack2nix/Main.hs rename to stackage2nix/Main.hs