mirror of
https://github.com/Smaug123/static-site-pdfs
synced 2025-10-05 15:38:40 +00:00
49 lines
1.4 KiB
Nix
49 lines
1.4 KiB
Nix
{
|
|
description = "PDFs hosted on patrickstevens.co.uk";
|
|
|
|
inputs = {
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
scripts.url = "github:Smaug123/flake-shell-script";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
scripts,
|
|
}: let
|
|
commit = self.shortRev or "dirty";
|
|
date = self.lastModifiedDate or self.lastModified or "19700101";
|
|
version = "1.0.0+${builtins.substring 0 8 date}.${commit}";
|
|
in
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in let
|
|
texlive = pkgs.texlive.combine {
|
|
inherit (pkgs.texlive) scheme-basic mdframed etoolbox zref needspace tikz-cd mathtools metafont pgf beamer listings caption fancyvrb eso-pic;
|
|
};
|
|
in {
|
|
packages.default = pkgs.stdenv.mkDerivation {
|
|
__contentAddressed = true;
|
|
inherit version;
|
|
pname = "patrickstevens.co.uk-pdfs";
|
|
src = ./.;
|
|
buildInputs = [texlive];
|
|
buildPhase = ''
|
|
${pkgs.bash}/bin/sh ${scripts.lib.createShellScript pkgs "latex" ./build.sh}/run.sh .
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp ./**/*.pdf $out
|
|
cp ./**/*.tex $out
|
|
cp ./pdf-targets.txt $out
|
|
'';
|
|
};
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [pkgs.alejandra pkgs.shellcheck texlive];
|
|
};
|
|
});
|
|
}
|