Skip to content

Commit

Permalink
remove a compiler-dependent derivation and instead expose derivations
Browse files Browse the repository at this point in the history
  • Loading branch information
liesnikov authored and jespercockx committed Apr 12, 2024
1 parent 1da4ffd commit eebfa9e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
7 changes: 3 additions & 4 deletions flake.lock

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

32 changes: 14 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,31 @@
tcDir = "lib";
src = ./.;
};

withCompiler = compiler:
let haskellPackages =
if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
agda2hs-hs =
haskellPackages.callCabal2nixWithOptions "agda2hs" ./. "--jailbreak" {};
in pkgs.callPackage ./agda2hs.nix {
agda2hs-pkg = options:
pkgs.haskellPackages.haskellSrc2nix {
name = "agda2hs";
src = ./.;
extraCabal2nixOptions = options;
};
agda2hs-hs = pkgs.haskellPackages.callPackage (agda2hs-pkg "--jailbreak") {};
agda2hs-expr = import ./agda2hs.nix;
agda2hs = pkgs.callPackage agda2hs-expr {
inherit self;
agda2hs = agda2hs-hs;
inherit (haskellPackages) ghcWithPackages;
inherit (pkgs.haskellPackages) ghcWithPackages;
};
agda2hs = withCompiler "default";

agda2hs-hs =
pkgs.haskellPackages.callCabal2nixWithOptions "agda2hs" ./. "--jailbreak" {};
in {
packages = {
inherit agda2hs-lib;
agda2hs = agda2hs.agda2hs;
inherit (agda2hs) agda2hs;
default = agda2hs.agda2hs;
};
lib = {
withPackages = agda2hs.withPackages;
inherit withCompiler;
inherit (agda2hs) withPackages;
inherit agda2hs-expr agda2hs-pkg agda2hs-hs;
};
devShells.default = pkgs.haskellPackages.shellFor {
packages = p: [agda2hs-hs];
packages = p: [agda2hs-pkg];
buildInputs = with pkgs.haskellPackages; [
cabal-install
cabal2nix
Expand Down

0 comments on commit eebfa9e

Please sign in to comment.