test case
This commit is contained in:
commit
f2f5d4c732
3 changed files with 77 additions and 0 deletions
25
flake.lock
Normal file
25
flake.lock
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1655567057,
|
||||
"narHash": "sha256-Cc5hQSMsTzOHmZnYm8OSJ5RNUp22bd5NADWLHorULWQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e0a42267f73ea52adc061a64650fddc59906fc99",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
48
flake.nix
Normal file
48
flake.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
description = "This is a test if lualatex works";
|
||||
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
type = "indirect";
|
||||
id = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {self, nixpkgs} :
|
||||
let
|
||||
|
||||
# System types to support.
|
||||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||
|
||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
|
||||
# Nixpkgs instantiated for supported system types.
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
|
||||
|
||||
in {
|
||||
packages = forAllSystems (system:
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
latexdeps = {inherit (pkgs.texlive) scheme-full;};
|
||||
latex = pkgs.texlive.combine latexdeps;
|
||||
in {
|
||||
default = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "output.pdf";
|
||||
buildInputs = [latex];
|
||||
src = self;
|
||||
buildPhase = ''
|
||||
lualatex src/Main.tex
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp Main.pdf $out/output.pdf
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
4
src/Main.tex
Normal file
4
src/Main.tex
Normal file
|
@ -0,0 +1,4 @@
|
|||
\documentclass{scrartcl}
|
||||
\begin{document}
|
||||
Hello World!
|
||||
\end{document}
|
Loading…
Reference in a new issue