Properly build the cv using nix
This commit is contained in:
parent
f69a52dcce
commit
b1bfec14a9
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
*.tuc
|
*.tuc
|
||||||
*.log
|
*.log
|
||||||
*.pdf
|
*.pdf
|
||||||
|
/result
|
||||||
|
|
53
flake.nix
53
flake.nix
|
@ -1,42 +1,45 @@
|
||||||
{
|
{
|
||||||
description = "";
|
description = "My CV";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
...
|
|
||||||
}: let
|
}: let
|
||||||
inherit (flake-utils.lib) eachSystem defaultSystems;
|
inherit (flake-utils.lib) eachDefaultSystem;
|
||||||
in
|
in
|
||||||
{
|
eachDefaultSystem (system: let
|
||||||
}
|
|
||||||
// (eachSystem defaultSystems) (system: let
|
|
||||||
pkgs = import nixpkgs {inherit system;};
|
pkgs = import nixpkgs {inherit system;};
|
||||||
inherit (pkgs.lib.strings) concatMapStringsSep;
|
inherit (pkgs.lib.strings) concatMapStringsSep;
|
||||||
|
inherit (pkgs.lib.sources) sourceFilesBySuffices;
|
||||||
in {
|
in {
|
||||||
devShell = pkgs.mkShell {
|
packages = {
|
||||||
packages = with pkgs; [
|
default =
|
||||||
texlive.combined.scheme-context
|
pkgs.runCommand "build-cv" {
|
||||||
roboto
|
OSFONTDIR =
|
||||||
roboto-slab
|
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
|
||||||
roboto-mono
|
(with pkgs; [
|
||||||
];
|
roboto
|
||||||
shellHook = let
|
roboto-slab
|
||||||
font-path =
|
roboto-mono
|
||||||
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
|
]);
|
||||||
(with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
roboto
|
texlive.combined.scheme-context
|
||||||
roboto-slab
|
];
|
||||||
roboto-mono
|
input = sourceFilesBySuffices self [".tex"];
|
||||||
]);
|
} ''
|
||||||
in ''
|
cp ${self}/*.tex .
|
||||||
export OSFONTDIR='${font-path}'
|
context cv
|
||||||
mtxrun --script fonts --reload --force
|
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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue