Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
liesnikov committed Jan 16, 2024
1 parent 7addadf commit 5ed6eb3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/agda-core-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Build agda-core"
on:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre568310.eabe8d3eface/nixexprs.tar.xz
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build .#agda-core --print-build-logs
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
with:
nix_path: nixpkgs=https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre568310.eabe8d3eface/nixexprs.tar.xz
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build --print-build-logs
- run: nix build .#agda-core-lib --print-build-logs
12 changes: 7 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,30 @@
inherit self;
inherit (pkgs.haskellPackages) agda2hs;
inherit (pkgs.haskellPackages) ghcWithPackages;
};
};
agda2hs = agda2hsPackages.withPackages [agda2hslib scopelib];
agda-core = pkgs.haskellPackages.callPackage ./nix/agda-core.nix {inherit agda2hs;};
in rec {
packages = rec {
agda2hs = agda2hsPackages.withPackages [agda2hslib scopelib];
packages = {
agda-core-lib = agdaDerivation
{ name = "agda-core-lib";
pname = "agda-core-lib";
meta = {};
libraryName = "agda-core";
libraryFile = "core.agda-lib";
tcDir = "src";
tcDir = "src"; # typecheck all files in the src directory
buildInputs = [ agda2hslib scopelib ];
src = ./.;
};
agda-core = pkgs.haskellPackages.callPackage ./nix/agda-core.nix { inherit agda2hs;};
agda-core = agda-core;
default = agda-core;
};

devShells.default = pkgs.haskellPackages.shellFor {
packages = p: [packages.agda-core];
buildInputs = with pkgs.haskellPackages; [
cabal-install
cabal2nix
haskell-language-server
(agda2hsPackages.withPackages [ agda2hslib scopelib])
(pkgs.agda.withPackages [ agda2hslib scopelib ])
Expand Down
7 changes: 7 additions & 0 deletions nix/agda-core.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# this package is produced by calling cabal2nix . in the parent directory
# and then changing the following:
# add an agda2hs argument
# add buildTools = [agda2hs];
# change src to ../. instead of ./.
# add preBuild = ''make alllib'';
# maybe there's a better way to do it automatically, but I can't see it immediately
{ mkDerivation, base, lib, agda2hs}:
mkDerivation {
pname = "agda-core";
Expand Down

0 comments on commit 5ed6eb3

Please sign in to comment.