Create a transcoder crate

This commit is contained in:
Zoe Roux 2023-04-05 22:24:24 +09:00
parent a7d8863998
commit bc6fdec360
No known key found for this signature in database
6 changed files with 1472 additions and 10 deletions

View File

@ -1,4 +1,5 @@
{pkgs ? import <nixpkgs> {}}: let
pwd = ./.;
venvDir = "./scanner/.venv";
pythonPkgs = ./scanner/requirements.txt;
in
@ -13,18 +14,23 @@ in
])
python3
python3Packages.pip
cargo
rustfmt
rustc
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
shellHook = ''
# Install python modules
SOURCE_DATE_EPOCH=$(date +%s)
if [ ! -d "${venvDir}" ]; then
${pkgs.python3}/bin/python3 -m venv ${venvDir}
source ${venvDir}/bin/activate
export PIP_DISABLE_PIP_VERSION_CHECK=1
pip install -r ${pythonPkgs} >&2
else
source ${venvDir}/bin/activate
fi
# Install python modules
SOURCE_DATE_EPOCH=$(date +%s)
if [ ! -d "${venvDir}" ]; then
${pkgs.python3}/bin/python3 -m venv ${pwd}/${venvDir}
source ${venvDir}/bin/activate
export PIP_DISABLE_PIP_VERSION_CHECK=1
pip install -r ${pythonPkgs} >&2
else
source ${venvDir}/bin/activate
fi
'';
}

1
transcoder/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1435
transcoder/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

7
transcoder/Cargo.toml Normal file
View File

@ -0,0 +1,7 @@
[package]
name = "transcoder"
version = "0.1.0"
edition = "2021"
[dependencies]
rocket = "=0.5.0-rc.3"

1
transcoder/rustfmt.toml Normal file
View File

@ -0,0 +1 @@
hard_tabs = true

12
transcoder/src/main.rs Normal file
View File

@ -0,0 +1,12 @@
#[macro_use]
extern crate rocket;
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index])
}