cv/flake.nix

52 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2022-05-24 04:04:17 +01:00
{
2022-05-26 03:33:07 +01:00
description = "My CV";
2022-05-24 04:04:17 +01:00
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
2022-05-26 03:33:07 +01:00
self,
2022-05-24 04:04:17 +01:00
nixpkgs,
flake-utils,
}: let
2022-05-26 03:33:07 +01:00
inherit (flake-utils.lib) eachDefaultSystem;
2022-05-24 04:04:17 +01:00
in
2022-05-26 03:33:07 +01:00
eachDefaultSystem (system: let
2022-05-24 04:04:17 +01:00
pkgs = import nixpkgs {inherit system;};
inherit (pkgs.lib.strings) concatMapStringsSep;
2022-05-26 03:33:07 +01:00
inherit (pkgs.lib.sources) sourceFilesBySuffices;
2022-05-24 04:04:17 +01:00
in {
2022-05-26 03:33:07 +01:00
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 = ''
2022-05-26 03:33:07 +01:00
context cv
'';
installPhase = ''
2022-05-26 03:33:07 +01:00
mkdir -p $out
cp cv.pdf $out/cv.pdf
'';
};
2022-05-24 04:04:17 +01:00
};
2022-05-26 03:33:07 +01:00
# Legacy nix command support
# TODO(tlater): Remove once 22.05 is adopted
defaultPackage = self.packages.${system}.default;
2022-05-24 04:04:17 +01:00
});
}