summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix66
1 files changed, 47 insertions, 19 deletions
diff --git a/flake.nix b/flake.nix
index 29c76fe..a79574b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,30 +2,58 @@
description = "My CV";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
- flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
+ latex-utils = {
+ url = "github:jmmaloney4/latex-utils";
+ inputs = {
+ flake-parts.follows = "flake-parts";
+ systems.follows = "systems";
+ };
+ };
+ files.url = "github:mightyiam/files";
+ flake-parts.url = "github:hercules-ci/flake-parts";
+ systems.url = "github:nix-systems/default";
};
- outputs = { self, nixpkgs, flake-utils, nix-filter, ... }: {
- overlays.default = import ./nix/overlay.nix { inherit nix-filter; };
- } // flake-utils.lib.eachDefaultSystem (system: let
- pkgs = import nixpkgs {
- inherit system;
- overlays = [ self.overlays.default ];
- };
- in {
- packages = {
- inherit (pkgs.haskellPackages) mycv;
- default = pkgs.haskellPackages.mycv;
- };
+ outputs = inputs@{ self, flake-parts, latex-utils, ... }: flake-parts.lib.mkFlake { inherit self inputs; } {
+ systems = import inputs.systems;
+
+ imports = [
+ latex-utils.modules.flake.latex-utils
+ inputs.files.flakeModules.default
+ ];
- devShells.default = pkgs.haskellPackages.shellFor {
- packages = p: [ p.mycv ];
- withHoogle = true;
- buildInputs = with pkgs.haskellPackages; [
- cabal-install
- hpack
+ latex-utils = {
+ documents = [
+ {
+ name = "cv.pdf";
+ src = ./.;
+ inputFile = "cv.tex";
+ }
+ ];
+ };
+
+
+ perSystem = { config, pkgs, ... }: {
+ devShells.default = pkgs.mkShellNoCC {
+ inputsFrom = [
+ config.devShells.latex-utils
+ ];
+ nativeBuildInputs = [
+ config.files.writer.drv
];
};
+
+ files.files = [
+ {
+ path_ = ".latexmkrc";
+ drv = pkgs.writeText ".latexmkrc" /* perl */ ''
+ $out_dir = './build';
+ $pdf_mode = 1;
+ $pdflatex = 'pdflatex -shell-escape -interaction=nonstopmode %O %S';
+ '';
+ }
+ ];
};
+ };
}