From 11e64a91ffa938e3aa392a2566f7d28988f76c57 Mon Sep 17 00:00:00 2001 From: Fernando Ayats Date: Sun, 5 May 2024 17:03:52 +0200 Subject: [PATCH] testing stuff --- src/machine.rs | 30 ++++++++++++++++++++++++++++++ src/main.rs | 1 + 2 files changed, 31 insertions(+) create mode 100644 src/machine.rs 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;