nix-user-chroot 2.1.0

Install & Run nix without root permissions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::env;
use std::path::PathBuf;

/// Thin wrapper around `nix::unistd::mkdtemp` that prepends $TMPDIR
/// when the template is relative.
pub fn mkdtemp(template: &str) -> nix::Result<PathBuf> {
    let template = if template.starts_with('/') {
        PathBuf::from(template)
    } else {
        env::temp_dir().join(template)
    };
    nix::unistd::mkdtemp(&template)
}