cv/flake.nix

52 lines
1.2 KiB
Nix

{
description = "My CV";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}: let
inherit (flake-utils.lib) eachDefaultSystem;
in
eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
inherit (pkgs.lib.strings) concatMapStringsSep;
inherit (pkgs.lib.sources) sourceFilesBySuffices;
in {
packages = {
default = pkgs.stdenvNoCC.mkDerivation {
name = "cv";
src = sourceFilesBySuffices self [".tex"];
buildInputs = with pkgs; [
texlive.combined.scheme-context
];
OSFONTDIR =
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
(with pkgs; [
roboto
roboto-slab
roboto-mono
]);
buildPhase = ''
context cv
'';
installPhase = ''
mkdir -p $out
cp cv.pdf $out/cv.pdf
'';
};
};
# Legacy nix command support
# TODO(tlater): Remove once 22.05 is adopted
defaultPackage = self.packages.${system}.default;
});
}