From 59e2d3fa6f4c0c81ad31589f2c5205b4d05499c6 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Fri, 6 Feb 2026 09:13:38 -0600 Subject: Added flake.nix --- flake.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 19 deletions(-) (limited to 'flake.nix') 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'; + ''; + } + ]; }; + }; } -- cgit v1.2.3