cv/flake.nix

55 lines
1.5 KiB
Nix

{
description = "William Hai's CV in Typst";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
fonts = with pkgs; [ libertinus ];
fontconf = pkgs.makeFontsConf {
fontDirectories = fonts;
};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [ typst ] ++ fonts;
FONTCONFIG_FILE = fontconf;
};
packages.cv = pkgs.stdenvNoCC.mkDerivation {
name = "william-hai-cv";
src = ./.;
nativeBuildInputs = with pkgs; [ typst ] ++ fonts;
FONTCONFIG_FILE = fontconf;
buildPhase = ''
typst compile cv.typ cv.pdf
'';
installPhase = ''
mkdir -p $out
cp cv.pdf $out/
'';
};
packages.cv-pt = pkgs.stdenvNoCC.mkDerivation {
name = "william-hai-cv-pt";
src = ./.;
nativeBuildInputs = with pkgs; [ typst ] ++ fonts;
FONTCONFIG_FILE = fontconf;
buildPhase = ''
typst compile cv-pt.typ cv-pt.pdf
'';
installPhase = ''
mkdir -p $out
cp cv-pt.pdf $out/
'';
};
packages.default = self.packages.${system}.cv;
}
);
}