{ writeTextFile, stdenv, ruby } : { env, runScript } : let name = env.pname; # Sandboxing script chroot-user = writeTextFile { name = "chroot-user"; executable = true; destination = "/bin/chroot-user"; text = '' #! ${ruby}/bin/ruby ${builtins.readFile ./chroot-user.rb} ''; }; in stdenv.mkDerivation { name = "${name}-userenv"; buildInputs = [ ruby ]; preferLocalBuild = true; buildCommand = '' mkdir -p $out/bin cat > $out/bin/${name} < $out/libexec/run <