diff --git a/src/machine.rs b/src/machine.rs new file mode 100644 index 0000000..d986c8f --- /dev/null +++ b/src/machine.rs @@ -0,0 +1,30 @@ +use std::path::PathBuf; + +use crate::Result; + + +#[test] +fn api_design() { + let host = Local::new(); + let target = LocalRoot::new(); + let system = (host, target); + + let result = system.build("github:NixOS/nixpkgs#hello^out"); + system.run([ + "ln", + "-vsfT", + result, + "/tmp/foo" + ]); +} + +pub trait System { + fn new() -> Self; + + fn build(&self) -> Result; +} + +pub struct SystemT { + host: Host, + target: Target +} diff --git a/src/main.rs b/src/main.rs index 8b164d3..a6e9d1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,7 @@ mod logging; mod nixos; mod search; mod util; +mod machine; use crate::interface::NHParser; use crate::interface::NHRunnable;