Systemsicherheit/flake.nix
Paul Zinselmeyer 0d1dcf5b1e
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 3m8s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 48s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 19s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 8s
[Assignment-6] Task 5 and 6 and flake change
In Task 5 ist sind noch vier Byte nicht benutzt, die laut
Aufgabenstellung scheinbar vorgesehen sind. Mit padded_password, saved
ebp, return address und input komme ich auf 36 Byte, in der vorgegebenen
Tabelle ist aber Platz für 40.
2024-06-23 11:57:12 +02:00

64 lines
1.8 KiB
Nix

{
description = "LaTeX Documents for Systemsicherheit";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};
outputs = { self, nixpkgs }: let
assignments = [
"Assignment 4 - Protokollsicherheit (Praxis)"
"Assignment 5 - Software Security - Teil 1"
"Assignment 6 - Software Security - Teil 2"
];
forAllSystems = function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system: function {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
});
forAllAssignments = function:
nixpkgs.lib.genAttrs assignments (assignment: function assignment);
texPackages = pkgs: pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
};
in rec {
packages = forAllSystems({system, pkgs}: forAllAssignments(assignment: let
tex = texPackages pkgs;
document = pkgs.stdenvNoCC.mkDerivation rec {
name = assignment;
src = self;
buildInputs = [ pkgs.coreutils tex ];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
cd "./${assignment}"
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -interaction=nonstopmode -pdf -lualatex \
"./abgabe.tex"
'';
installPhase = ''
mkdir -p $out
cp *.pdf $out/
'';
};
in document) // {
default = packages.${system}.${pkgs.lib.last assignments};
});
devShells = forAllSystems({pkgs, ...}: let
tex = texPackages pkgs;
in {
default = pkgs.mkShell {
packages = [ pkgs.coreutils tex ];
};
});
hydraJobs = packages;
};
}