nix: add flake
This also enables building the PDF files using `nix build`
This commit is contained in:
parent
f663253642
commit
ea663ea04a
2 changed files with 97 additions and 0 deletions
55
flake.nix
Normal file
55
flake.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
description = "Ambroisie's CV";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
futils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, futils } @ inputs:
|
||||
futils.lib.eachSystem futils.lib.allSystems (system:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
buildInputs = with pkgs; [
|
||||
gnumake
|
||||
(texlive.combine {
|
||||
inherit (texlive)
|
||||
scheme-small
|
||||
# Build script
|
||||
latexmk
|
||||
# Extra packages needed
|
||||
clearsans
|
||||
fontaxes
|
||||
textpos
|
||||
ifmtarg
|
||||
marvosym
|
||||
;
|
||||
})
|
||||
];
|
||||
in
|
||||
{
|
||||
devShell = pkgs.mkShell {
|
||||
name = "cv";
|
||||
inherit buildInputs;
|
||||
};
|
||||
|
||||
defaultPackage = pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "cv";
|
||||
version = self.rev or "dirty";
|
||||
src = ./.;
|
||||
|
||||
inherit buildInputs;
|
||||
|
||||
buildPhase = ''
|
||||
make
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dm644 en.pdf $out/share/en.pdf
|
||||
install -Dm644 fr.pdf $out/share/fr.pdf
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue