From 8e2f719c058546bcfc0682f9777e0d6952b05c88 Mon Sep 17 00:00:00 2001
From: Millian Poquet <millian.poquet@irit.fr>
Date: Wed, 8 May 2024 18:45:02 +0200
Subject: [PATCH] nix: add typst shell

---
 flake.lock | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 flake.nix  |  12 +++++-
 2 files changed, 122 insertions(+), 2 deletions(-)

diff --git a/flake.lock b/flake.lock
index b4bd2c3..94d77c6 100644
--- a/flake.lock
+++ b/flake.lock
@@ -60,6 +60,44 @@
         "url": "https://framagit.org/batsim/batsim"
       }
     },
+    "crane": {
+      "inputs": {
+        "nixpkgs": [
+          "typst-flake",
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1698166613,
+        "narHash": "sha256-y4rdN4flxRiROqNi1waMYIZj/Fs7L2OrszFk/1ry9vU=",
+        "owner": "ipetkov",
+        "repo": "crane",
+        "rev": "b7db46f0f1751f7b1d1911f6be7daf568ad5bc65",
+        "type": "github"
+      },
+      "original": {
+        "owner": "ipetkov",
+        "repo": "crane",
+        "type": "github"
+      }
+    },
+    "flake-parts": {
+      "inputs": {
+        "nixpkgs-lib": "nixpkgs-lib"
+      },
+      "locked": {
+        "lastModified": 1696343447,
+        "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
+        "owner": "hercules-ci",
+        "repo": "flake-parts",
+        "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
+        "type": "github"
+      },
+      "original": {
+        "id": "flake-parts",
+        "type": "indirect"
+      }
+    },
     "flake-utils": {
       "inputs": {
         "systems": "systems"
@@ -120,6 +158,24 @@
         "type": "github"
       }
     },
+    "nixpkgs-lib": {
+      "locked": {
+        "dir": "lib",
+        "lastModified": 1696019113,
+        "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a",
+        "type": "github"
+      },
+      "original": {
+        "dir": "lib",
+        "owner": "NixOS",
+        "ref": "nixos-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
     "nixpkgs-pytest": {
       "locked": {
         "lastModified": 1669833724,
@@ -136,6 +192,22 @@
         "type": "github"
       }
     },
+    "nixpkgs_2": {
+      "locked": {
+        "lastModified": 1714906307,
+        "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
     "nur-kapack": {
       "inputs": {
         "flake-utils": [
@@ -167,7 +239,8 @@
         "flake-utils": "flake-utils",
         "intervalset-flake": "intervalset-flake",
         "nixpkgs": "nixpkgs",
-        "nur-kapack": "nur-kapack"
+        "nur-kapack": "nur-kapack",
+        "typst-flake": "typst-flake"
       }
     },
     "systems": {
@@ -184,6 +257,43 @@
         "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"
+      }
+    },
+    "typst-flake": {
+      "inputs": {
+        "crane": "crane",
+        "flake-parts": "flake-parts",
+        "nixpkgs": "nixpkgs_2",
+        "systems": "systems_2"
+      },
+      "locked": {
+        "lastModified": 1713366680,
+        "narHash": "sha256-Hg3gb18E9GfFsuBhzEAbLRKhk3Jdj6fGBRSjjzsdedI=",
+        "owner": "typst",
+        "repo": "typst",
+        "rev": "21c78abd6eecd0f6b3208405c7513be3bbd8991c",
+        "type": "github"
+      },
+      "original": {
+        "owner": "typst",
+        "repo": "typst",
+        "rev": "21c78abd6eecd0f6b3208405c7513be3bbd8991c",
+        "type": "github"
+      }
     }
   },
   "root": "root",
diff --git a/flake.nix b/flake.nix
index 4776c5d..a3720f9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,9 +27,12 @@
       inputs.intervalset.follows = "intervalset-flake";
       inputs.flake-utils.follows = "flake-utils";
     };
+    typst-flake = {
+      url = "github:typst/typst?rev=21c78abd6eecd0f6b3208405c7513be3bbd8991c";
+    };
   };
 
-  outputs = { self, nixpkgs, nur-kapack, intervalset-flake, flake-utils, batprotocol-flake, batsim-flake }:
+  outputs = { self, nixpkgs, nur-kapack, intervalset-flake, flake-utils, batprotocol-flake, batsim-flake, typst-flake }:
     flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
       let
         pkgs = import nixpkgs { inherit system; };
@@ -39,6 +42,7 @@
         batprotopkgs = batprotocol-flake.packages.${system};
         intervalsetpkgs = intervalset-flake.packages.${system};
         batpkgs = batsim-flake.packages-release.${system};
+        typstpkgs = typst-flake.packages.${system};
       in rec {
         packages = {
           batsim = batpkgs.batsim;
@@ -156,6 +160,12 @@
             ];
           };
 
+          typst-shell = pkgs.mkShell {
+            buildInputs = [
+              typstpkgs.typst-dev
+            ];
+          };
+
           parquet-data-extract = pkgs.mkShell {
             buildInputs = [
               pkgs.pqrs
-- 
GitLab