tool for me to use if i drop nixos
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add deo crate

IamPyu 097bf4c2 16f27256

+148 -4
+85 -1
Cargo.lock
··· 40 40 version = "0.1.0" 41 41 42 42 [[package]] 43 + name = "deo" 44 + version = "0.1.0" 45 + dependencies = [ 46 + "dirs", 47 + "nix 0.31.2", 48 + ] 49 + 50 + [[package]] 51 + name = "dirs" 52 + version = "6.0.0" 53 + source = "registry+https://github.com/rust-lang/crates.io-index" 54 + checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" 55 + dependencies = [ 56 + "dirs-sys", 57 + ] 58 + 59 + [[package]] 60 + name = "dirs-sys" 61 + version = "0.5.0" 62 + source = "registry+https://github.com/rust-lang/crates.io-index" 63 + checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" 64 + dependencies = [ 65 + "libc", 66 + "option-ext", 67 + "redox_users", 68 + "windows-sys 0.61.2", 69 + ] 70 + 71 + [[package]] 43 72 name = "dmx" 44 73 version = "0.1.0" 45 74 dependencies = [ ··· 91 120 ] 92 121 93 122 [[package]] 123 + name = "getrandom" 124 + version = "0.2.17" 125 + source = "registry+https://github.com/rust-lang/crates.io-index" 126 + checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" 127 + dependencies = [ 128 + "cfg-if", 129 + "libc", 130 + "wasi", 131 + ] 132 + 133 + [[package]] 94 134 name = "hashbrown" 95 135 version = "0.16.1" 96 136 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 130 170 checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" 131 171 132 172 [[package]] 173 + name = "libredox" 174 + version = "0.1.15" 175 + source = "registry+https://github.com/rust-lang/crates.io-index" 176 + checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" 177 + dependencies = [ 178 + "libc", 179 + ] 180 + 181 + [[package]] 133 182 name = "linux-raw-sys" 134 183 version = "0.12.1" 135 184 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 169 218 ] 170 219 171 220 [[package]] 221 + name = "nix" 222 + version = "0.31.2" 223 + source = "registry+https://github.com/rust-lang/crates.io-index" 224 + checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" 225 + dependencies = [ 226 + "bitflags", 227 + "cfg-if", 228 + "cfg_aliases", 229 + "libc", 230 + ] 231 + 232 + [[package]] 233 + name = "option-ext" 234 + version = "0.2.0" 235 + source = "registry+https://github.com/rust-lang/crates.io-index" 236 + checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 237 + 238 + [[package]] 172 239 name = "proc-macro2" 173 240 version = "1.0.106" 174 241 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 197 264 ] 198 265 199 266 [[package]] 267 + name = "redox_users" 268 + version = "0.5.2" 269 + source = "registry+https://github.com/rust-lang/crates.io-index" 270 + checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" 271 + dependencies = [ 272 + "getrandom", 273 + "libredox", 274 + "thiserror", 275 + ] 276 + 277 + [[package]] 200 278 name = "rustix" 201 279 version = "1.1.4" 202 280 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 223 301 "libc", 224 302 "log", 225 303 "memchr", 226 - "nix", 304 + "nix 0.30.1", 227 305 "radix_trie", 228 306 "unicode-segmentation", 229 307 "unicode-width", ··· 342 420 version = "0.2.2" 343 421 source = "registry+https://github.com/rust-lang/crates.io-index" 344 422 checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 423 + 424 + [[package]] 425 + name = "wasi" 426 + version = "0.11.1+wasi-snapshot-preview1" 427 + source = "registry+https://github.com/rust-lang/crates.io-index" 428 + checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 345 429 346 430 [[package]] 347 431 name = "windows-link"
+3 -3
Cargo.toml
··· 1 1 [workspace] 2 2 resolver = "3" 3 - members = ["crates/demeter", "crates/dmx"] 3 + members = ["crates/demeter", "crates/deo", "crates/dmx"] 4 4 5 5 [workspace.metadata] 6 6 ··· 10 10 11 11 [workspace.dependencies] 12 12 dmx = { version = "0.1.0", path = "crates/dmx" } 13 + deo = { version = "0.1.0", path = "crates/deo" } 13 14 14 - nix = "0.31.2" 15 + nix = { version = "0.31.2", features = ["hostname", "user"] } 15 16 log = "0.4.29" 16 17 thiserror = "2.0.18" 17 18 anyhow = "1.0.102" ··· 24 25 mime = "0.3.17" 25 26 indexmap = "2.13.0" 26 27 strum = { version = "0.28.0", features = ["derive"] } 27 -
+9
crates/deo/Cargo.toml
··· 1 + [package] 2 + name = "deo" 3 + version = "0.1.0" 4 + edition.workspace = true 5 + license.workspace = true 6 + 7 + [dependencies] 8 + nix.workspace = true 9 + dirs = "6.0.0"
+51
crates/deo/src/lib.rs
··· 1 + use std::{env, ffi::OsString, path::PathBuf, sync::LazyLock}; 2 + 3 + pub fn is_root() -> bool { 4 + nix::unistd::getuid().is_root() 5 + } 6 + 7 + pub const DEMETER_DIR: &str = "/var/lib/demeter"; 8 + 9 + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Default)] 10 + pub enum Path { 11 + /// [DEMETER_DIR] 12 + #[default] 13 + Root, 14 + /// Binary path 15 + Bin, 16 + /// Store path 17 + Store, 18 + } 19 + 20 + pub fn get_path(p: Path) -> PathBuf { 21 + let root = PathBuf::from(DEMETER_DIR); 22 + 23 + match p { 24 + Path::Root => root, 25 + Path::Bin => root.join("bin"), 26 + Path::Store => root.join("store"), 27 + } 28 + } 29 + 30 + /// Binary path used by demeter for generating wrappers (/var/lib/demeter/bin) 31 + pub const BIN_PATH: LazyLock<PathBuf> = LazyLock::new(|| { 32 + let bin = PathBuf::from(DEMETER_DIR).join("bin"); 33 + bin 34 + }); 35 + 36 + /// Path of the demeter store (/var/lib/demeter/store) 37 + pub const STORE_PATH: LazyLock<PathBuf> = LazyLock::new(|| { 38 + let store = PathBuf::from(DEMETER_DIR).join("store"); 39 + store 40 + }); 41 + 42 + /// split `PATH` variable excluding [BIN_PATH] 43 + pub fn split_paths() -> Option<Vec<PathBuf>> { 44 + let path = env::var("PATH").ok()?; 45 + let paths = env::split_paths(&path); 46 + Some(paths.filter(|x| x != &*BIN_PATH).collect()) 47 + } 48 + 49 + pub fn join_paths() -> Option<OsString> { 50 + env::join_paths(split_paths()?).ok() 51 + }