Skip to content

Commit

Permalink
Refactor dev shells
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed May 26, 2024
1 parent 9ada2a8 commit 3a5ae22
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
nix develop --command bash -c "cabal build"
- name: Test
# NOTE: The onlyCabal shell does not contain cardano-node
# NOTE: The ci shell does not contain cardano-node
run: |
nix develop .#onlyCabal --command bash -c "cabal test"
nix develop .#ci --command bash -c "cabal test"
62 changes: 33 additions & 29 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,43 @@
hspec
HUnit
]);

mkShell = { isCI ? false }:
pkgs.mkShell {
packages =
let
libs = [
pkgs.pkg-config
pkgs.libsodium-vrf
pkgs.blst
pkgs.secp256k1
pkgs.zlib
];
tools = [
pkgs.cabal-install
ghcWithPackages
];
devTools = [
hsPkgs.haskell-language-server
hsPkgs.fourmolu
hsPkgs.cabal-fmt
hsPkgs.hoogle
];
in
libs ++ tools ++
pkgs.lib.optionals (isCI == false) devTools ++
# Cardano-node to build against
pkgs.lib.optional (isCI == false) inputs.cardano-node.packages.${system}.cardano-node
;
};

in
{
legacyPackages = pkgs;

devShells.default = pkgs.mkShell {
packages =
let
libs = [
pkgs.pkg-config
pkgs.libsodium-vrf
pkgs.blst
pkgs.secp256k1
pkgs.zlib
];
tools = [
pkgs.cabal-install
hsPkgs.haskell-language-server
hsPkgs.fourmolu
hsPkgs.cabal-fmt
];
in
libs ++ tools ++ [
# Cardano-node to build against
inputs.cardano-node.packages.${system}.cardano-node
];
};

# Only cabal and no cardano-node to run integration tests
devShells.onlyCabal = pkgs.mkShell {
packages = [
pkgs.cabal-install
];
};
devShells.default = mkShell { };
# No dev tools and without cardano-node to run integration tests
devShells.ci = mkShell { isCI = true; };
});

nixConfig = {
Expand Down

0 comments on commit 3a5ae22

Please sign in to comment.