about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-08-23T07·28+0300
committerclbot <clbot@tvl.fyi>2024-08-23T15·02+0000
commit35d5811eec4f2d610e811d24b412aa05479a7358 (patch)
treef1ba8a9f0dfa93585061bb87da27848ef65b0913 /tvix
parentc321a5136f44113302a0ba3eba2a8eeb5042d669 (diff)
feat(nix-compat): add constants for mime types r/8560
This adds the MIME types Nix uses when uploading files to a S3 bucket /
HTTP endpoint. It ignores them when retrieving.

Change-Id: I75fa96d5e53349f0470bbe8cbba93f961fbd5f05
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12266
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix')
-rw-r--r--tvix/nix-compat/src/nix_http/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tvix/nix-compat/src/nix_http/mod.rs b/tvix/nix-compat/src/nix_http/mod.rs
index cbb629784612..89ba147b8071 100644
--- a/tvix/nix-compat/src/nix_http/mod.rs
+++ b/tvix/nix-compat/src/nix_http/mod.rs
@@ -2,6 +2,13 @@ use tracing::trace;
 
 use crate::nixbase32;
 
+/// The mime type used for NAR files, both compressed and uncompressed
+pub const MIME_TYPE_NAR: &str = "application/x-nix-nar";
+/// The mime type used for NARInfo files
+pub const MIME_TYPE_NARINFO: &str = "text/x-nix-narinfo";
+/// The mime type used for the `nix-cache-info` file
+pub const MIME_TYPE_CACHE_INFO: &str = "text/x-nix-cache-info";
+
 /// Parses a `14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar`
 /// string and returns the nixbase32-decoded digest, as well as the compression
 /// suffix (which might be empty).