Initial CV in Typst with Nix flake
This commit is contained in:
commit
5305224b2b
4 changed files with 292 additions and 0 deletions
41
flake.nix
Normal file
41
flake.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
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.default = self.packages.${system}.cv;
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue