forked from the-distro/ofborg
move simple-build to a separate project
This is mostly intended as an example and since this is only useful for testing it should be relatively safe.
This commit is contained in:
parent
1c0c5e304c
commit
7ccb4943a1
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -461,6 +461,14 @@ dependencies = [
|
||||||
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ofborg-simple-build"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"ofborg 0.1.8",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl"
|
name = "openssl"
|
||||||
version = "0.9.24"
|
version = "0.9.24"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"ofborg"
|
"ofborg",
|
||||||
|
"ofborg-simple-build"
|
||||||
]
|
]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|
10
ofborg-simple-build/Cargo.toml
Normal file
10
ofborg-simple-build/Cargo.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "ofborg-simple-build"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Daiderd Jordan <daiderd@gmail.com>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ofborg = { path = "../ofborg" }
|
||||||
|
|
||||||
|
log = "0.3.8"
|
|
@ -1,18 +1,22 @@
|
||||||
use ofborg::config;
|
#[macro_use]
|
||||||
use ofborg::nix;
|
extern crate log;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
fn main() {
|
use ofborg::config;
|
||||||
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
|
use ofborg::nix;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
ofborg::setup_log();
|
ofborg::setup_log();
|
||||||
|
|
||||||
|
log::info!("Loading config...");
|
||||||
|
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
|
||||||
let nix = cfg.nix();
|
let nix = cfg.nix();
|
||||||
|
|
||||||
|
log::info!("Running build...");
|
||||||
match nix.safely_build_attrs(
|
match nix.safely_build_attrs(
|
||||||
&Path::new("./"),
|
&Path::new("./"),
|
||||||
nix::File::DefaultNixpkgs,
|
nix::File::DefaultNixpkgs,
|
Loading…
Reference in a new issue