-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
63 lines (58 loc) · 2.07 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "Agda core";
inputs.nixpkgs.url = github:NixOS/nixpkgs;
inputs.flake-utils.url = github:numtide/flake-utils;
inputs.agda2hs = {
url = "github:agda/agda2hs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
inputs.scope = {
url = "github:jespercockx/scope";
inputs.nixpkgs.follows = "nixpkgs";
inputs.agda2hs.follows = "agda2hs";
inputs.flake-utils.follows = "flake-utils";
};
outputs = {self, nixpkgs, flake-utils, agda2hs, scope}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {inherit system;};
agda2hs-lib = agda2hs.packages.${system}.agda2hs-lib;
scope-lib = scope.packages.${system}.scope-lib;
agda2hs-custom = (agda2hs.lib.${system}.withPackages) [agda2hs-lib scope-lib];
agda-core-pkg = import ./nix/agda-core.nix;
agda-core = pkgs.haskellPackages.callPackage ./nix/agda-core.nix {agda2hs = agda2hs-custom;};
in {
packages = {
inherit agda-core;
agda-core-lib = pkgs.agdaPackages.mkDerivation
{ name = "agda-core-lib";
pname = "agda-core-lib";
meta = {};
libraryName = "agda-core";
libraryFile = "core.agda-lib";
preBuild = ''
echo "module Everything where" > Everything.agda
find src -name '*.agda' | sed -e 's/src\///;s/\//./g;s/\.agda$//;s/^/import /' >> Everything.agda
'';
buildInputs = [ agda2hs-lib scope-lib ];
src = ./.;
};
agda-core-hs = agda-core;
default = agda-core;
};
lib = {
inherit agda-core-pkg;
};
devShells.default = pkgs.haskellPackages.shellFor {
packages = p: [agda-core];
buildInputs = with pkgs.haskellPackages; [
cabal-install
cabal2nix
haskell-language-server
agda2hs-custom
(pkgs.agda.withPackages [ agda2hs-lib scope-lib ])
];
};
});
}