cv/flake.nix

46 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.runCommand "build-cv" {
OSFONTDIR =
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
(with pkgs; [
roboto
roboto-slab
roboto-mono
]);
buildInputs = with pkgs; [
texlive.combined.scheme-context
];
input = sourceFilesBySuffices self [".tex"];
} ''
cp ${self}/*.tex .
context cv
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;
});
}