Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit 56555e7

Browse files
committed
feat: enable full-scale Nix evaluation in sandboxed environment
- Refactor nixec crate from monolithic main function to more modular code - Implement complete sandboxed nix-instantiate execution using birdcage - Add public run_nixec() function for testing and external usage - Update birdcage to git version with fixing nix call `unshare(CLONE_FS)` - Add anyhow dependency and improve error handling - Extract hardcoded paths to constants for maintainability - Update build system and development environment dependencies
1 parent e699f08 commit 56555e7

6 files changed

Lines changed: 187 additions & 84 deletions

File tree

Cargo.lock

Lines changed: 10 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ version = "0.3.0"
1313
[profile.release]
1414
codegen-units = 1
1515
lto = true
16-
opt-level = 3
16+
opt-level = "z"
1717
strip = true
1818

1919
[dependencies]
@@ -83,6 +83,7 @@ prodash = { version = "30.0.1", features = [
8383
] }
8484

8585
[patch.crates-io]
86+
birdcage = { git = "https://github.com/nrdxp/birdcage", branch = "clone_fs" }
8687
tracing = { git = "https://github.com/nrdxp/tracing", branch = "hierarchical" }
8788
tracing-appender = { git = "https://github.com/nrdxp/tracing", branch = "hierarchical" }
8889
tracing-core = { git = "https://github.com/nrdxp/tracing", branch = "hierarchical" }

build/Cargo.nix

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15213,6 +15213,10 @@ rec {
1521315213
];
1521415214
src = lib.cleanSourceWith { filter = sourceFilter; src = ../crates/nixec; };
1521515215
dependencies = [
15216+
{
15217+
name = "anyhow";
15218+
packageId = "anyhow";
15219+
}
1521615220
{
1521715221
name = "birdcage";
1521815222
packageId = "birdcage";
@@ -18761,9 +18765,9 @@ rec {
1876118765
};
1876218766
"rustls" = rec {
1876318767
crateName = "rustls";
18764-
version = "0.23.14";
18768+
version = "0.23.35";
1876518769
edition = "2021";
18766-
sha256 = "1a0b2sdvq69vqrz08wvjmlqafzh7pfgzhn9j0n107f9wd529jpa1";
18770+
sha256 = "13xxk2qqchibd7pr0laqq6pzayx9xm4rb45d8rz68kvxday58gsk";
1876718771
dependencies = [
1876818772
{
1876918773
name = "log";
@@ -18812,13 +18816,14 @@ rec {
1881218816
];
1881318817
features = {
1881418818
"aws-lc-rs" = [ "aws_lc_rs" ];
18815-
"aws_lc_rs" = [ "dep:aws-lc-rs" "webpki/aws_lc_rs" ];
18819+
"aws_lc_rs" = [ "dep:aws-lc-rs" "webpki/aws-lc-rs" "aws-lc-rs/aws-lc-sys" "aws-lc-rs/prebuilt-nasm" ];
1881618820
"brotli" = [ "dep:brotli" "dep:brotli-decompressor" "std" ];
18817-
"default" = [ "aws_lc_rs" "logging" "std" "tls12" ];
18818-
"fips" = [ "aws_lc_rs" "aws-lc-rs?/fips" ];
18821+
"default" = [ "aws_lc_rs" "logging" "prefer-post-quantum" "std" "tls12" ];
18822+
"fips" = [ "aws_lc_rs" "aws-lc-rs?/fips" "webpki/aws-lc-rs-fips" ];
1881918823
"hashbrown" = [ "dep:hashbrown" ];
1882018824
"log" = [ "dep:log" ];
1882118825
"logging" = [ "log" ];
18826+
"prefer-post-quantum" = [ "aws_lc_rs" ];
1882218827
"read_buf" = [ "rustversion" "std" ];
1882318828
"ring" = [ "dep:ring" "webpki/ring" ];
1882418829
"rustversion" = [ "dep:rustversion" ];
@@ -18882,11 +18887,19 @@ rec {
1888218887
};
1888318888
"rustls-pki-types" = rec {
1888418889
crateName = "rustls-pki-types";
18885-
version = "1.9.0";
18890+
version = "1.13.0";
1888618891
edition = "2021";
18887-
sha256 = "0mcc901b4hm2ql2qwpf2gzqhqn6d7iag92hr872wjr8c6wsnws8f";
18892+
sha256 = "0yjzsnpv1sjbnfxbbmrnyimd23jip48nav6l9hr1rjd06vcjl64l";
1888818893
libName = "rustls_pki_types";
18894+
dependencies = [
18895+
{
18896+
name = "zeroize";
18897+
packageId = "zeroize";
18898+
optional = true;
18899+
}
18900+
];
1888918901
features = {
18902+
"alloc" = [ "dep:zeroize" ];
1889018903
"default" = [ "alloc" ];
1889118904
"std" = [ "alloc" ];
1889218905
"web" = [ "web-time" ];
@@ -18896,9 +18909,9 @@ rec {
1889618909
};
1889718910
"rustls-webpki" = rec {
1889818911
crateName = "rustls-webpki";
18899-
version = "0.102.8";
18912+
version = "0.103.8";
1890018913
edition = "2021";
18901-
sha256 = "1sdy8ks86b7jpabpnb2px2s7f1sq8v0nqf6fnlvwzm4vfk41pjk4";
18914+
sha256 = "0lpymb84bi5d2pm017n39nbiaa5cd046hgz06ir29ql6a8pzmz9g";
1890218915
libName = "webpki";
1890318916
dependencies = [
1890418917
{
@@ -18920,8 +18933,10 @@ rec {
1892018933
];
1892118934
features = {
1892218935
"alloc" = [ "ring?/alloc" "pki-types/alloc" ];
18923-
"aws_lc_rs" = [ "dep:aws-lc-rs" ];
18924-
"default" = [ "std" "ring" ];
18936+
"aws-lc-rs" = [ "dep:aws-lc-rs" "aws-lc-rs/aws-lc-sys" "aws-lc-rs/prebuilt-nasm" ];
18937+
"aws-lc-rs-fips" = [ "dep:aws-lc-rs" "aws-lc-rs/fips" ];
18938+
"aws-lc-rs-unstable" = [ "aws-lc-rs" "aws-lc-rs/unstable" ];
18939+
"default" = [ "std" ];
1892518940
"ring" = [ "dep:ring" ];
1892618941
"std" = [ "alloc" "pki-types/std" ];
1892718942
};

crates/nixec/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ version = "0.1.0"
66
[dependencies]
77
birdcage = "^0.8"
88

9+
anyhow.workspace = true
910
thiserror.workspace = true

0 commit comments

Comments
 (0)