[Assignment-7] Repair Flake

This commit is contained in:
Paul Zinselmeyer 2024-07-03 16:32:57 +02:00 committed by saschato
parent 25a5ca3e2d
commit 6779eb608e

View file

@ -16,7 +16,7 @@
"aarch64-linux"
] (system: function {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
});
forAllAssignments = function:
@ -28,34 +28,32 @@
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
version = builtins.substring 0 8 lastModifiedDate;
nixpkgsFor = system: import nixpkgs { inherit system; overlays = [ self.overlay ]; };
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};
}) // {
"x86_64-linux"."Assignment 7" = (nixpkgsFor "x86_64-linux").signatureProxy;
};
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};
"Assignment 7" = pkgs.signatureProxy;
});
devShells = forAllSystems({pkgs, ...}: let
tex = texPackages pkgs;
@ -98,7 +96,6 @@
};
};
hydraJobs = packages;
};
}