git.delta.rocks / jrsonnet / refs/commits / d9405376effd

difftreelog

source

cmds/fleet/src/better_nix_eval.rs813 Bsourcehistory
1//! Wrapper around nix repl, which allows to work on nix code, without relying on2//! nix libexpr. I mean, nix libexpr is good, but until it has no C bindings, this is the royal PITA.34use std::collections::HashMap;5use std::ffi::{OsStr, OsString};6use std::fmt::{self, Display};7use std::path::PathBuf;8use std::process::Stdio;9use std::sync::{Arc, OnceLock};1011use anyhow::{anyhow, bail, ensure, Context, Result};12use better_command::{ClonableHandler, Handler, NixHandler, NoopHandler};13use futures::StreamExt;14use itertools::Itertools;15use serde::de::DeserializeOwned;16use serde::{Deserialize, Serialize};17use tokio::io::AsyncWriteExt;18use tokio::process::{ChildStderr, ChildStdin, ChildStdout, Command};19use tokio::select;20use tokio::sync::{mpsc, oneshot, Mutex};21use tracing::{debug, error, warn, Level};22232425