Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add nix flake, align cabal with CI #236

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
description = "A Klister flake";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
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" ./. { };
};
haskellPackages = pkgs.haskellPackages.extend overlay;
in {
# nix build
packages.default = haskellPackages.klister;

# 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/
'';
};
}
);
}
8 changes: 4 additions & 4 deletions klister.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.5, GHC==8.8.4, GHC==8.10.2, GHC==9.0.1, GHC==9.2.5
tested-with: GHC==8.10.7, GHC==9.2.5, GHC==9.4, GHC==9.6
build-type: Simple
data-files:
stdlib/defun.kl
Expand Down Expand Up @@ -39,7 +39,7 @@ common deps
extra >= 1.6.18 && < 1.8,
filepath >= 1.4.2 && < 1.5,
lens >= 4.17.1 && < 5.3,
megaparsec >= 7.0.5 && < 9.3,
megaparsec >= 7.0.5 && < 9.7,
mtl >= 2.2.2 && < 2.4,
prettyprinter >= 1.2 && < 1.8,
text >= 1.2,
Expand Down Expand Up @@ -114,7 +114,7 @@ executable klister
repl
ghc-options: -Wall
build-depends:
optparse-applicative >= 0.14 && < 0.18,
optparse-applicative >= 0.14 && < 0.19,
klister
default-language: Haskell2010

Expand All @@ -132,7 +132,7 @@ test-suite klister-tests
ghc-options: -Wall
build-depends:
call-stack ^>= 0.4.0,
hedgehog >= 1.2 && < 1.4,
hedgehog >= 1.2 && < 1.5,
klister,
silently ^>= 1.2,
tasty ^>= 1.4,
Expand Down
Loading