2023-12-14 20:33:55 +00:00
|
|
|
{
|
|
|
|
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};
|
2023-12-15 00:40:00 +00:00
|
|
|
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;
|
|
|
|
});
|
2023-12-14 20:33:55 +00:00
|
|
|
in
|
|
|
|
{
|
2023-12-15 00:40:00 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2023-12-14 20:33:55 +00:00
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
lean4
|
2023-12-15 00:29:41 +00:00
|
|
|
python3
|
2023-12-15 00:40:00 +00:00
|
|
|
scheme-custom
|
2023-12-14 20:33:55 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|