generated from Patagia/template-nix
Compare commits
1 commit
4cbf4cda28
...
6949cd1bd7
Author | SHA1 | Date | |
---|---|---|---|
6949cd1bd7 |
12 changed files with 46 additions and 10 deletions
29
Cargo.lock
generated
29
Cargo.lock
generated
|
@ -1362,6 +1362,7 @@ dependencies = [
|
|||
"serde_json",
|
||||
"varlink",
|
||||
"varlink_generator",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2486,6 +2487,15 @@ version = "1.0.18"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.27"
|
||||
|
@ -3799,6 +3809,16 @@ dependencies = [
|
|||
"atomic-waker",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
|
||||
dependencies = [
|
||||
"same-file",
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "want"
|
||||
version = "0.3.1"
|
||||
|
@ -3959,6 +3979,15 @@ version = "0.4.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-util"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
use anyhow::Result;
|
||||
|
||||
use internal::io_patagia_hostd::{Call_Apply, Call_Describe, Label, Machine, VarlinkInterface};
|
||||
use internal::ipc::patagia::io_patagia_hostd::{
|
||||
Call_Apply, Call_Describe, Label, Machine, VarlinkInterface,
|
||||
};
|
||||
|
||||
const LISTEN_ADDRESS: &str = "unix:/tmp/patagia/io.patagia.hostd";
|
||||
|
||||
|
@ -35,7 +37,7 @@ impl VarlinkInterface for PatagiaHostd {
|
|||
|
||||
fn main() -> Result<()> {
|
||||
let hostd = PatagiaHostd;
|
||||
let hostd_iface = internal::io_patagia_hostd::new(Box::new(hostd));
|
||||
let hostd_iface = internal::ipc::patagia::io_patagia_hostd::new(Box::new(hostd));
|
||||
|
||||
let svc = varlink::VarlinkService::new(
|
||||
"io.patagia.hostd",
|
||||
|
|
|
@ -11,3 +11,4 @@ varlink = "11.0.1"
|
|||
|
||||
[build-dependencies]
|
||||
varlink_generator = "10.1.0"
|
||||
walkdir = "2.5.0"
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
extern crate varlink_generator;
|
||||
|
||||
use walkdir::WalkDir;
|
||||
|
||||
fn main() {
|
||||
// iterate over all varlink files
|
||||
std::fs::read_dir("src").unwrap().for_each(|f| {
|
||||
let f = f.unwrap();
|
||||
if f.file_name().to_str().unwrap().ends_with(".varlink") {
|
||||
varlink_generator::cargo_build_tosource(&f.path().display().to_string(), true);
|
||||
// walk dir to find varlink files
|
||||
for entry in WalkDir::new("src").into_iter().filter_map(|e| e.ok()) {
|
||||
if entry.file_name().to_str().unwrap().ends_with(".varlink") {
|
||||
varlink_generator::cargo_build_tosource(&entry.path().display().to_string(), true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
2
internal/src/ipc/mod.rs
Normal file
2
internal/src/ipc/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
pub mod patagia;
|
||||
pub mod systemd;
|
1
internal/src/ipc/patagia/mod.rs
Normal file
1
internal/src/ipc/patagia/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod io_patagia_hostd;
|
1
internal/src/ipc/systemd/mod.rs
Normal file
1
internal/src/ipc/systemd/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod io_systemd_hostname;
|
|
@ -1,2 +1 @@
|
|||
pub mod io_patagia_hostd;
|
||||
pub mod io_systemd_hostname;
|
||||
pub mod ipc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue