From 563372c33148f218ff5d7b7e8ef26d56867de436 Mon Sep 17 00:00:00 2001 From: 0qln <0qln@proton.me> Date: Tue, 20 Jan 2026 13:07:26 +0100 Subject: [PATCH] initial commit --- .envrc | 1 + .gitignore | 7 ++++ .latexmkrc | 2 ++ flake.lock | 61 ++++++++++++++++++++++++++++++++ flake.nix | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 172 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 .latexmkrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32ed70f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +out +latexout +latex.out +direnv +result +.direnv +target diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..80954ed --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,2 @@ +$out_dir = "out"; +$pdf_mode = 4; # lualatex diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d1101e2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1762844143, + "narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..bc19f3c --- /dev/null +++ b/flake.nix @@ -0,0 +1,101 @@ +{ + description = "Verteilte Anwedungen -- Solo Projekt"; + + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4"; + }; + + outputs = inputs @ { + flake-parts, + self, + ... + }: + flake-parts.lib.mkFlake {inherit inputs;} { + imports = []; + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: + with pkgs.lib; let + latexPackages = with pkgs; [ + latexrun + (texlive.withPackages + (ps: + with ps; [ + amsmath + biber + biblatex + changepage + csquotes + enumitem + fontaxes + latexmk + listings + minted + newtx + newtxsf + newtxtt + scheme-medium + textpos + times + titlesec + transparent + upquote + ])) + ]; + in { + # Per-system attributes can be defined here. The self' and inputs' + # module parameters provide easy access to attributes of the same + # system. + packages = with pkgs; { + default = stdenvNoCC.mkDerivation rec { + name = "insert-project-name"; + version = "1.0.0"; + src = ./.; + buildInputs = latexPackages; + buildPhase = + # sh + '' + cd . + + latexmk \ + -pdf \ + -l -dir-report -file-line-error -verbose \ + -interaction=nonstopmode \ + "${name}.tex" + ''; + installPhase = + # sh + '' + mkdir -p $out/share $out/log $out/artifacts + cp out/${name}.pdf "$out/share/${name}" + cp out/*.log $out/log/ + cp -r out/* $out/artifacts + ''; + }; + }; + + devShells.default = with pkgs; + mkShell { + nativeBuildInputs = []; + packages = [mermaid-cli] ++ latexPackages; + + shellHook = + # bash + '' + ''; + }; + }; + flake = { + # The usual flake attributes can be defined here, including system- + # agnostic ones like nixosModule and system-enumerating ones, although + # those are more easily expressed in perSystem. + }; + }; +}