initial commit

This commit is contained in:
2026-01-20 13:07:26 +01:00
commit 563372c331
5 changed files with 172 additions and 0 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
out
latexout
latex.out
direnv
result
.direnv
target

2
.latexmkrc Normal file
View File

@@ -0,0 +1,2 @@
$out_dir = "out";
$pdf_mode = 4; # lualatex

61
flake.lock generated Normal file
View File

@@ -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
}

101
flake.nix Normal file
View File

@@ -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.
};
};
}