Skip to content

Commit d7412ad

Browse files
Add Nix flake
1 parent e0e5a5c commit d7412ad

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

flake.lock

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
description = "Explorations in combinatory logic with Agda";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let pkgs = nixpkgs.legacyPackages.${system};
12+
agdaPackages = pkgs.agdaPackages;
13+
14+
version = "0";
15+
everythingFile = "./index.agda";
16+
in {
17+
packages.combinatory-logic = agdaPackages.mkDerivation {
18+
inherit version;
19+
pname = "combinatory-logic";
20+
src = ./.;
21+
buildInputs = [ agdaPackages.standard-library ];
22+
inherit everythingFile;
23+
};
24+
25+
packages.combinatory-logic-doc = agdaPackages.mkDerivation {
26+
inherit version;
27+
pname = "combinatory-logic-doc";
28+
src = ./.;
29+
buildInputs = [ agdaPackages.standard-library ];
30+
31+
buildPhase = ''
32+
runHook preBuild
33+
agda -i ${dirOf everythingFile} --html ${everythingFile} --html-dir html
34+
runHook postBuild
35+
'';
36+
37+
installPhase = ''
38+
runHook preInstall
39+
mkdir -p $out
40+
mkdir -p $out/doc
41+
cp html/* $out/doc
42+
runHook postInstall
43+
'';
44+
};
45+
46+
defaultPackage = self.packages.${system}.combinatory-logic;
47+
});
48+
}

0 commit comments

Comments
 (0)