Skip to content

Cabal flags can be interpreted by cabal2nix #16

@CMCDragonkai

Description

@CMCDragonkai

If you see something like:

executable Generate
  if flag(Generators)
    Buildable: True
  else
    Buildable: False
  hs-source-dirs: Scripts
  main-is: Generate.hs
  other-modules: Helpers
  default-language: Haskell2010
  ghc-options: -Wall

  if flag(Generators)
    build-depends: base >=4.6 && <5,
                   language-c <0.7,
                   containers,
                   process,
                   regex-pcreexecutable Generate
  if flag(Generators)
    Buildable: True
  else
    Buildable: False
  hs-source-dirs: Scripts
  main-is: Generate.hs
  other-modules: Helpers
  default-language: Haskell2010
  ghc-options: -Wall

  if flag(Generators)
    build-depends: base >=4.6 && <5,
                   language-c <0.7,
                   containers,
                   process,
                   regex-pcre

In the cabal file:

You basically have to do:

cabal2nix --flag Generators . >./cabal.nix

Render this into the README.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions