commit f2f5d4c73241c1a2a020e54f44a8c74b3a94220c Author: nerf van nerfingen Date: Wed Jun 22 11:53:20 2022 +0200 test case diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..348723b --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c52d6b9 --- /dev/null +++ b/flake.nix @@ -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 + ''; + }; + } + ); + }; +} + + diff --git a/src/Main.tex b/src/Main.tex new file mode 100644 index 0000000..0e9fd41 --- /dev/null +++ b/src/Main.tex @@ -0,0 +1,4 @@ +\documentclass{scrartcl} +\begin{document} + Hello World! +\end{document}