-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,57 @@ | ||
{ | ||
description = "A Klister flake"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
description = "A klister flake"; | ||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
overlay = final: prev: { | ||
klister = prev.callCabal2nix "klister" ./. { }; | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
|
||
hPkgs = | ||
pkgs.haskell.packages."ghc966"; # need to match Stackage LTS version | ||
# from stack.yaml snapshot | ||
|
||
myDevTools = [ | ||
hPkgs.ghc # GHC compiler in the desired version (will be available on PATH) | ||
hPkgs.ghcid # Continuous terminal Haskell compile checker | ||
hPkgs.ormolu # Haskell formatter | ||
hPkgs.hlint # Haskell codestyle checker | ||
hPkgs.hoogle # Lookup Haskell documentation | ||
hPkgs.haskell-language-server # LSP server for editor | ||
hPkgs.implicit-hie # auto generate LSP hie.yaml file from cabal | ||
hPkgs.retrie # Haskell refactoring tool | ||
# hPkgs.cabal-install | ||
stack-wrapped | ||
pkgs.zlib # External C library needed by some Haskell packages | ||
]; | ||
|
||
# Wrap Stack to work with our Nix integration. We don't want to modify | ||
# stack.yaml so non-Nix users don't notice anything. | ||
# - no-nix: We don't want Stack's way of integrating Nix. | ||
# --system-ghc # Use the existing GHC on PATH (will come from this Nix file) | ||
# --no-install-ghc # Don't try to install GHC if no matching GHC found on PATH | ||
stack-wrapped = pkgs.symlinkJoin { | ||
name = "stack"; # will be available as the usual `stack` in terminal | ||
paths = [ pkgs.stack ]; | ||
buildInputs = [ pkgs.makeWrapper ]; | ||
postBuild = '' | ||
wrapProgram $out/bin/stack \ | ||
--add-flags "\ | ||
--no-nix \ | ||
--system-ghc \ | ||
--no-install-ghc \ | ||
" | ||
''; | ||
}; | ||
haskellPackages = pkgs.haskellPackages.extend overlay; | ||
in { | ||
# nix build | ||
packages.default = haskellPackages.klister; | ||
devShells.default = pkgs.mkShell { | ||
buildInputs = myDevTools; | ||
|
||
# nix develop | ||
devShells.default = haskellPackages.shellFor { | ||
withHoogle = true; | ||
packages = p: [ p.klister ]; | ||
buildInputs = with haskellPackages; [ | ||
cabal-install | ||
haskell-language-server | ||
eventlog2html | ||
]; | ||
shellHook = '' | ||
export KLISTERPATH="$(pwd)"/examples/ | ||
''; | ||
# Make external Nix c libraries like zlib known to GHC, like | ||
# pkgs.haskell.lib.buildStackProject does | ||
# https://github.com/NixOS/nixpkgs/blob/d64780ea0e22b5f61cd6012a456869c702a72f20/pkgs/development/haskell-modules/generic-stack-builder.nix#L38 | ||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath myDevTools; | ||
}; | ||
} | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ author: David Christiansen <[email protected]>, Samuel Géline | |
maintainer: David Christiansen <[email protected]>, Samuel Gélineau <[email protected]> | ||
license: BSD-3-Clause | ||
license-file: LICENSE | ||
tested-with: GHC==8.10.7, GHC==9.2.5, GHC==9.4, GHC==9.6 | ||
tested-with: GHC==9.2.5, GHC==9.4, GHC==9.6 | ||
build-type: Simple | ||
data-files: | ||
stdlib/defun.kl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
resolver: lts-20.25 | ||
resolver: lts-22.39 | ||
packages: | ||
- . | ||
extra-deps: | ||
- transformers-0.6.1.0@sha256:7e7feea5fc9071375a973a48290fee6664e3eba38eb7028ce04850911f1ad0d4,3146 | ||
- mtl-2.3.1 | ||
- exceptions-0.10.7 | ||
- hedgehog-1.2 | ||
- tasty-hedgehog-1.4.0.0@sha256:d29ba1e363d9d41da5b34d4f320ab761cbc9c19fda6091d2d650351604c2d9aa,1795 | ||
|
||
nix: | ||
enable: true |