datasheets/flake.nix

44 lines
1.3 KiB
Nix

{
description = "Sinara datasheets";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux";};
latex-pkgs = pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-small collection-latexextra collection-fontsextra
collection-fontsrecommended cbfonts-fd cbfonts palatino textgreek helvetic
greek-inputenc maths-symbols mathpazo babel isodate tcolorbox etoolbox
pgfplots visualtikz quantikz tikz-feynman circuitikz
minted pst-graphicx;
};
python-pkgs = with pkgs.python3Packages; [ pygments ];
in rec {
all-pdfs = pkgs.stdenvNoCC.mkDerivation rec {
name = "datasheets-pdfs";
src = self;
buildInputs = [ latex-pkgs ] ++ python-pkgs;
# is there a better way to get .aux/.out files correct than to just run latexpdf twice?
buildPhase = ''
make all
make all
'';
installPhase = ''
mkdir $out
cp build/*.pdf $out
'';
};
devShells.x86_64-linux.default = pkgs.mkShell {
name = "datasheet-dev-shell";
buildInputs = [ latex-pkgs ] ++ python-pkgs;
};
};
}