about summary refs log tree commit diff
path: root/third_party/rustsec-advisory-db/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rustsec-advisory-db/default.nix')
-rw-r--r--third_party/rustsec-advisory-db/default.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/third_party/rustsec-advisory-db/default.nix b/third_party/rustsec-advisory-db/default.nix
index 2e280345ab..3d3b387be8 100644
--- a/third_party/rustsec-advisory-db/default.nix
+++ b/third_party/rustsec-advisory-db/default.nix
@@ -1,9 +1,24 @@
+# RustSec's advisory db for crates
+#
+# Update using:
+#
+#   nix-prefetch-git --quiet --url https://github.com/RustSec/advisory-db.git > third_party/rustsec-advisory-db/pin.json
+#
+# TODO(Profpatsch): automatically update in regular intervals
 { pkgs, ... }:
 
+let
+  pin = builtins.fromJSON (builtins.readFile ./pin.json);
+
+  date = builtins.head (builtins.split "T" pin.date);
+in
+
 pkgs.fetchFromGitHub {
+  name = "advisory-db-${date}";
   owner = "RustSec";
   repo = "advisory-db";
-  # TODO(Profpatsch): this will have to be updated regularly, how?
-  rev = "113188c62380753f01ff0df5edb7d67a300b143a";
-  sha256 = "0v086ybwr71zgs5nv8yr4w2w2d4daxx6in2s1sjb4m41q1r9p0wj";
+  inherit (pin)
+    rev
+    sha256
+  ;
 }