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
|
||||
*.log
|
||||
*.pdf
|
||||
/result
|
||||
|
|
53
flake.nix
53
flake.nix
|
@ -1,42 +1,45 @@
|
|||
{
|
||||
description = "";
|
||||
description = "My CV";
|
||||
|
||||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}: let
|
||||
inherit (flake-utils.lib) eachSystem defaultSystems;
|
||||
inherit (flake-utils.lib) eachDefaultSystem;
|
||||
in
|
||||
{
|
||||
}
|
||||
// (eachSystem defaultSystems) (system: let
|
||||
eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
inherit (pkgs.lib.strings) concatMapStringsSep;
|
||||
inherit (pkgs.lib.sources) sourceFilesBySuffices;
|
||||
in {
|
||||
devShell = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
texlive.combined.scheme-context
|
||||
roboto
|
||||
roboto-slab
|
||||
roboto-mono
|
||||
];
|
||||
shellHook = let
|
||||
font-path =
|
||||
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
|
||||
(with pkgs; [
|
||||
roboto
|
||||
roboto-slab
|
||||
roboto-mono
|
||||
]);
|
||||
in ''
|
||||
export OSFONTDIR='${font-path}'
|
||||
mtxrun --script fonts --reload --force
|
||||
'';
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue