Skip to content

Commit

Permalink
ci: update builds for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 26, 2022
1 parent a89f9b3 commit ef1cb18
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 37 deletions.
110 changes: 98 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 31 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,36 @@

overlays = [
theme-ec.overlays.default
] ++ nixpkgs.lib.optional (ci-detector.lib.notInCI) ec-fonts.overlays.default;
ec-fonts.overlays.default
];
};

tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
inherit (pkgs.texlive) scheme-full latex-bin latexmk;

latex-theme-ec = {
pkgs = [ pkgs.latex-theme-ec ] ++ nixpkgs.lib.optional (ci-detector.lib.notInCI) pkgs.ec-square-sans;
};
latex-theme-ec = {
pkgs = [ pkgs.latex-theme-ec pkgs.ec-square-sans ];
};
};

documentProperties = {
name = "nix-at-ec-presentation";
inputs = [
tex
tex-for-ci = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full latex-bin latexmk;

latex-theme-ec = {
pkgs = [ pkgs.latex-theme-ec ];
};
};

documentDerivation = pkgs.stdenvNoCC.mkDerivation {
name = "nix-at-ec--summer-of-nix-2022";

src = self;

buildInputs = [
pkgs.coreutils
pkgs.gnumake
# pkgs.openjdk
# pkgs.plantuml
# pkgs.pandoc
# pkgs.plantuml
# pkgs.nixpkgs-fmt
# pkgs.nixfmt
# pkgs.pympress
];
};

documentDrv = pkgs.stdenvNoCC.mkDerivation {
name = documentProperties.name + "-" + version;
src = self;
buildInputs = documentProperties.inputs;
configurePhase = ''
runHook preConfigure
substituteInPlace "src/nix-at-ec/version.tex" \
Expand All @@ -63,14 +62,21 @@
'';
};
in
rec {
{
# Nix shell / nix build
packages.default = documentDrv;
packages.default = if ci-detector.lib.inCI then
(documentDerivation.overrideAttrs (oldAttrs: {
buildInputs = [ oldAttrs.buildInputs ] ++ [ tex-for-ci ];
}))
else
(documentDerivation.overrideAttrs (oldAttrs: {
buildInputs = [ oldAttrs.buildInputs ] ++ [ tex ];
}));

# Nix develop
devShells.default = pkgs.mkShellNoCC {
name = documentProperties.name;
buildInputs = documentProperties.inputs;
name = "latex-devshell";
buildInputs = documentDerivation.buildInputs;
};
});
}

0 comments on commit ef1cb18

Please sign in to comment.