aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.envrc1
-rw-r--r--.gitignore2
-rw-r--r--README.md3
-rw-r--r--flake.lock330
-rw-r--r--flake.nix54
5 files changed, 390 insertions, 0 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..3550a30
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e370078
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+result/
+result
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5c55c8b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+## Build
+```nix build .```
+This will result in a PDF at `result/main.pdf`
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..def2532
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,330 @@
+{
+ "nodes": {
+ "devshell": {
+ "inputs": {
+ "nixpkgs": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1722113426,
+ "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
+ "owner": "numtide",
+ "repo": "devshell",
+ "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "devshell",
+ "type": "github"
+ }
+ },
+ "flake-compat": {
+ "locked": {
+ "lastModified": 1696426674,
+ "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+ "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+ "revCount": 57,
+ "type": "tarball",
+ "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
+ },
+ "original": {
+ "type": "tarball",
+ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
+ }
+ },
+ "flake-parts": {
+ "inputs": {
+ "nixpkgs-lib": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1722555600,
+ "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1687709756,
+ "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "flake-utils_2": {
+ "inputs": {
+ "systems": "systems_2"
+ },
+ "locked": {
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "git-hooks": {
+ "inputs": {
+ "flake-compat": [
+ "nixvim",
+ "flake-compat"
+ ],
+ "gitignore": "gitignore",
+ "nixpkgs": [
+ "nixvim",
+ "nixpkgs"
+ ],
+ "nixpkgs-stable": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1724857454,
+ "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "nixvim",
+ "git-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1724435763,
+ "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nix-darwin": {
+ "inputs": {
+ "nixpkgs": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1724561770,
+ "narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
+ "owner": "lnl7",
+ "repo": "nix-darwin",
+ "rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "lnl7",
+ "repo": "nix-darwin",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1709961763,
+ "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1724819573,
+ "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixvim": {
+ "inputs": {
+ "devshell": "devshell",
+ "flake-compat": "flake-compat",
+ "flake-parts": "flake-parts",
+ "git-hooks": "git-hooks",
+ "home-manager": "home-manager",
+ "nix-darwin": "nix-darwin",
+ "nixpkgs": "nixpkgs_2",
+ "nuschtosSearch": "nuschtosSearch",
+ "treefmt-nix": "treefmt-nix"
+ },
+ "locked": {
+ "lastModified": 1726148694,
+ "narHash": "sha256-bR7LFVtMjiVlO2OpmDSuLQ2XQr+h+JtVFYObAbThZSs=",
+ "owner": "nix-community",
+ "repo": "nixvim",
+ "rev": "27a0dd435dd3563f4cf9d788601fadfce8c59db6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixvim",
+ "type": "github"
+ }
+ },
+ "nuschtosSearch": {
+ "inputs": {
+ "flake-utils": "flake-utils_2",
+ "nixpkgs": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1724584782,
+ "narHash": "sha256-7FfHv7b1jwMPSu9SPY9hdxStk8E6EeSwzqdvV69U4BM=",
+ "owner": "NuschtOS",
+ "repo": "search",
+ "rev": "5a08d691de30b6fc28d58ce71a5e420f2694e087",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NuschtOS",
+ "repo": "search",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs",
+ "nixvim": "nixvim"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
+ "systems_2": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
+ "treefmt-nix": {
+ "inputs": {
+ "nixpkgs": [
+ "nixvim",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1724833132,
+ "narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
+ "owner": "numtide",
+ "repo": "treefmt-nix",
+ "rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "treefmt-nix",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..23b96bd
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,54 @@
+# Taken from https://flyx.org/nix-flakes-latex/
+{
+ description = "LaTeX Document Demo";
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ nixvim.url = "github:nix-community/nixvim";
+ };
+ outputs = {
+ self,
+ nixpkgs,
+ nixvim,
+ flake-utils,
+ }:
+ with flake-utils.lib;
+ eachSystem allSystems (system: let
+ pkgs = nixpkgs.legacyPackages.${system};
+ tex = pkgs.texlive.combine {
+ inherit (pkgs.texlive) scheme-basic cite pgf nicematrix latex-bin latexmk titlesec listings ieeetran;
+ };
+ nvim = nixvim.legacyPackages.x86_64-linux.makeNixvim {
+ plugins.lsp.enable = true;
+ colorschemes.gruvbox.enable = true;
+ };
+ in rec {
+ packages = {
+ document = pkgs.stdenvNoCC.mkDerivation rec {
+ name = "latex-demo-document";
+ src = self;
+ buildInputs = [ pkgs.coreutils pkgs.texliveFull pkgs.pandoc pkgs.texliveFull pkgs.tetex pkgs.zathura pkgs.kile];
+ phases = ["unpackPhase" "buildPhase" "installPhase"];
+ buildPhase = ''
+ runHook preBuild
+
+ export PATH="${pkgs.lib.makeBinPath buildInputs}";
+ #pandoc rpa.md -s -o rpa.tex --pdf-engine=pdflatex
+ mkdir -p .cache/texmf-var
+ env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
+ latexmk -f -interaction=nonstopmode -pdf -pdflatex \
+ main.tex
+ runHook postBuild
+ '';
+ installPhase = ''
+ runHook preInstall
+
+ install -m644 -D *.pdf $out/main.pdf
+
+ runHook postInstall
+ '';
+ };
+ };
+ defaultPackage = packages.document;
+ });
+}