feat(tvix): set up cargo rust project

First steps for baba

Change-Id: Id6a68c5630cb85f280f4dcc7b2acf10c02454fd6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4732
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Profpatsch 2021-12-28 14:29:30 +01:00
parent 9f0671edc9
commit 7c92b07efd
9 changed files with 56 additions and 0 deletions

10
tvix/.envrc Normal file
View file

@ -0,0 +1,10 @@
source_env ../.envrc
if type lorri &>/dev/null; then
echo "direnv: using lorri from PATH ($(type -p lorri))"
eval "$(lorri direnv)"
else
# fall back to using direnv's builtin nix support
# to prevent bootstrapping problems.
use nix
fi

3
tvix/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/target
/result-*
/result

8
tvix/.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"recommendations": [
"matklad.rust-analyzer"
],
"unwantedRecommendations": [
"rust-lang.rust"
]
}

7
tvix/Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "tvix"
version = "0.1.0"

10
tvix/Cargo.toml Normal file
View file

@ -0,0 +1,10 @@
[package]
name = "tvix"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "nix-store"

2
tvix/default.nix Normal file
View file

@ -0,0 +1,2 @@
{...}:
{}

10
tvix/shell.nix Normal file
View file

@ -0,0 +1,10 @@
let
depot = (import ./.. {});
pkgs = depot.third_party.nixpkgs;
in pkgs.mkShell {
buildInputs = [
pkgs.rustup
pkgs.rust-analyzer
];
}

View file

@ -0,0 +1,3 @@
fn main () {
println!("hello, nix");
}

3
tvix/src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, tvix!");
}