Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

# These are backup files generated by rustfmt
**/*.rs.bk

# Example nix directory
/.nix/
134 changes: 84 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ edition = "2018"

[dependencies]
nix = "0.17.*"
tempfile = "3"
tempfile = "3"
rooter = { git = "https://gitlab.com/jD91mZM2/rooter" }
26 changes: 26 additions & 0 deletions container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ENGINE=docker

if ! which "$ENGINE" &>/dev/null ; then
ENGINE=podman
fi

if ! which "$ENGINE" &>/dev/null ; then
echo "No docker or podman in PATH" >&2
exit 1
fi

read -d '' script <<EOF
cd /app/nix-user-chroot
mkdir .nix
cargo build

run() {
cargo run .nix "\$@"
}

export -f run
exec bash
EOF

# "$ENGINE" run -v .:/app -it rust bash -c "$script"
"$ENGINE" run -v ..:/app -it rust bash -c "$script"
Loading