-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
79 lines (73 loc) · 2.11 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "";
inputs = {
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
manifest = import ./lake-manifest.nix { inherit pkgs; };
scheme-custom = with pkgs; (texlive.combine {
inherit (texlive) scheme-basic
bigfoot
comment
enumitem
environ
etoolbox
fontawesome5
jknapltx
mathabx
mathabx-type1
metafont
ncctools
pgf
rsfs
soul
stmaryrd
tcolorbox
xcolor;
});
in
{
packages = {
app = pkgs.stdenv.mkDerivation {
pname = "bookshelf";
version = "0.1.0";
src = ./.;
nativeBuildInputs = with pkgs; [
git
lean4
scheme-custom
];
buildPhase = ''
mkdir -p .lake/packages
${pkgs.lib.foldlAttrs (s: key: val: s + ''
cp -a ${val}/src .lake/packages/${key}
chmod 755 .lake/packages/${key}/{,.git}
'') "" manifest}
export GIT_ORIGIN_URL="https://github.com/jrpotter/bookshelf.git"
export GIT_REVISION="${self.rev or "dirty"}"
lake build Bookshelf:docs
find .lake/build/doc \
\( -name "*.html.trace" -o -name "*.html.hash" \) \
-exec rm {} +
'';
installPhase = ''
mkdir $out
cp -a .lake/build/doc/* $out
'';
};
default = self.packages.${system}.app;
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
lean4
python3
scheme-custom
];
};
});
}