├── .envrc ├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── Cargo.lock ├── Cargo.nix ├── Cargo.toml ├── LICENSE ├── README.org ├── build.rs ├── contrib ├── gruvbox.theme └── solarized_dark.theme ├── crate-hashes.json ├── default.nix ├── default.theme ├── shell.nix └── src ├── cli.rs ├── format.rs ├── main.rs ├── module.rs ├── segments ├── mod.rs ├── segment_cwd.rs ├── segment_git.rs ├── segment_host.rs ├── segment_jobs.rs ├── segment_linebreak.rs ├── segment_nix.rs ├── segment_perms.rs ├── segment_ps.rs ├── segment_root.rs ├── segment_ssh.rs ├── segment_time.rs ├── segment_user.rs └── segment_virtualenv.rs └── theme.rs /.envrc: -------------------------------------------------------------------------------- 1 | eval "$(lorri direnv)" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | **/*.rs.bk 3 | result 4 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # This file is a template, and might need editing before it works on your project. 2 | # Official language image. Look for the different tagged releases at: 3 | # https://hub.docker.com/r/library/rust/tags/ 4 | image: "rust:latest" 5 | 6 | # Optional: Pick zero or more services to be used on all builds. 7 | # Only needed when using a docker container to run your tests in. 8 | # Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service 9 | #services: 10 | # - mysql:latest 11 | # - redis:latest 12 | # - postgres:latest 13 | 14 | # Optional: Install a C compiler, cmake and git into the container. 15 | # You will often need this when you (or any of your dependencies) depends on C code. 16 | before_script: 17 | - apt-get update -yqq 18 | - apt-get install -yqq --no-install-recommends build-essential gcc cmake libgit2-dev libssh2-1-dev 19 | 20 | # Use cargo to test the project 21 | test:cargo: 22 | script: 23 | - rustc --version && cargo --version # Print version info for debugging 24 | - cargo test --all --verbose 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | cache: cargo 3 | rust: 4 | - stable 5 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ansi_term" 5 | version = "0.11.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | dependencies = [ 8 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 9 | ] 10 | 11 | [[package]] 12 | name = "arrayref" 13 | version = "0.3.5" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | 16 | [[package]] 17 | name = "arrayvec" 18 | version = "0.4.12" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | dependencies = [ 21 | "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", 22 | ] 23 | 24 | [[package]] 25 | name = "atty" 26 | version = "0.2.13" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | dependencies = [ 29 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 30 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 31 | ] 32 | 33 | [[package]] 34 | name = "autocfg" 35 | version = "0.1.7" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | 38 | [[package]] 39 | name = "backtrace" 40 | version = "0.3.40" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | dependencies = [ 43 | "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 44 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 45 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 46 | "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 47 | ] 48 | 49 | [[package]] 50 | name = "backtrace-sys" 51 | version = "0.1.32" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | dependencies = [ 54 | "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", 55 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 56 | ] 57 | 58 | [[package]] 59 | name = "base64" 60 | version = "0.10.1" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | dependencies = [ 63 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 64 | ] 65 | 66 | [[package]] 67 | name = "bitflags" 68 | version = "1.2.1" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | 71 | [[package]] 72 | name = "blake2b_simd" 73 | version = "0.5.8" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | dependencies = [ 76 | "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 77 | "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", 78 | "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 79 | ] 80 | 81 | [[package]] 82 | name = "byteorder" 83 | version = "1.3.2" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | 86 | [[package]] 87 | name = "cc" 88 | version = "1.0.46" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | dependencies = [ 91 | "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", 92 | "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 93 | ] 94 | 95 | [[package]] 96 | name = "cfg-if" 97 | version = "0.1.10" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | 100 | [[package]] 101 | name = "chrono" 102 | version = "0.4.9" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | dependencies = [ 105 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 106 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", 107 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 108 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 109 | ] 110 | 111 | [[package]] 112 | name = "clap" 113 | version = "2.33.0" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | dependencies = [ 116 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 117 | "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", 118 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 119 | "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 120 | "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 121 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 122 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 123 | ] 124 | 125 | [[package]] 126 | name = "cloudabi" 127 | version = "0.0.3" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | dependencies = [ 130 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 131 | ] 132 | 133 | [[package]] 134 | name = "constant_time_eq" 135 | version = "0.1.4" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | 138 | [[package]] 139 | name = "crossbeam-utils" 140 | version = "0.6.6" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | dependencies = [ 143 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 144 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 145 | ] 146 | 147 | [[package]] 148 | name = "dirs" 149 | version = "2.0.2" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | dependencies = [ 152 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 153 | "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 154 | ] 155 | 156 | [[package]] 157 | name = "dirs-sys" 158 | version = "0.3.4" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | dependencies = [ 161 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 162 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 163 | "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 164 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 165 | ] 166 | 167 | [[package]] 168 | name = "failure" 169 | version = "0.1.6" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | dependencies = [ 172 | "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", 173 | "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 174 | ] 175 | 176 | [[package]] 177 | name = "failure_derive" 178 | version = "0.1.6" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | dependencies = [ 181 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 182 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 183 | "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 184 | "synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", 185 | ] 186 | 187 | [[package]] 188 | name = "flame" 189 | version = "0.2.2" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | dependencies = [ 192 | "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 193 | "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", 194 | "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", 195 | "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", 196 | "thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 197 | ] 198 | 199 | [[package]] 200 | name = "fuchsia-cprng" 201 | version = "0.1.1" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | 204 | [[package]] 205 | name = "getrandom" 206 | version = "0.1.12" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | dependencies = [ 209 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 210 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 211 | "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 212 | ] 213 | 214 | [[package]] 215 | name = "git2" 216 | version = "0.10.1" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | dependencies = [ 219 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 220 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 221 | "libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", 222 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 223 | "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 224 | ] 225 | 226 | [[package]] 227 | name = "idna" 228 | version = "0.2.0" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | dependencies = [ 231 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 232 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 233 | "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 234 | ] 235 | 236 | [[package]] 237 | name = "itoa" 238 | version = "0.4.4" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | 241 | [[package]] 242 | name = "jobserver" 243 | version = "0.1.17" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | dependencies = [ 246 | "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 247 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 248 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 249 | ] 250 | 251 | [[package]] 252 | name = "lazy_static" 253 | version = "0.2.11" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | 256 | [[package]] 257 | name = "lazy_static" 258 | version = "1.4.0" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | 261 | [[package]] 262 | name = "libc" 263 | version = "0.2.65" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | 266 | [[package]] 267 | name = "libgit2-sys" 268 | version = "0.9.1" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | dependencies = [ 271 | "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", 272 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 273 | "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", 274 | "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", 275 | ] 276 | 277 | [[package]] 278 | name = "libz-sys" 279 | version = "1.0.25" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | dependencies = [ 282 | "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", 283 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 284 | "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", 285 | "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", 286 | ] 287 | 288 | [[package]] 289 | name = "log" 290 | version = "0.4.8" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | dependencies = [ 293 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 294 | ] 295 | 296 | [[package]] 297 | name = "matches" 298 | version = "0.1.8" 299 | source = "registry+https://github.com/rust-lang/crates.io-index" 300 | 301 | [[package]] 302 | name = "nodrop" 303 | version = "0.1.14" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | 306 | [[package]] 307 | name = "num-integer" 308 | version = "0.1.41" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | dependencies = [ 311 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 312 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 313 | ] 314 | 315 | [[package]] 316 | name = "num-traits" 317 | version = "0.2.8" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | dependencies = [ 320 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 321 | ] 322 | 323 | [[package]] 324 | name = "num_cpus" 325 | version = "1.10.1" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | dependencies = [ 328 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 329 | ] 330 | 331 | [[package]] 332 | name = "percent-encoding" 333 | version = "2.1.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | 336 | [[package]] 337 | name = "pkg-config" 338 | version = "0.3.16" 339 | source = "registry+https://github.com/rust-lang/crates.io-index" 340 | 341 | [[package]] 342 | name = "powerline-rs" 343 | version = "0.2.1" 344 | dependencies = [ 345 | "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 346 | "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", 347 | "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 348 | "flame 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 349 | "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 350 | "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", 351 | ] 352 | 353 | [[package]] 354 | name = "proc-macro2" 355 | version = "1.0.6" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | dependencies = [ 358 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 359 | ] 360 | 361 | [[package]] 362 | name = "quote" 363 | version = "1.0.2" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | dependencies = [ 366 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 367 | ] 368 | 369 | [[package]] 370 | name = "rand_core" 371 | version = "0.3.1" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | dependencies = [ 374 | "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 375 | ] 376 | 377 | [[package]] 378 | name = "rand_core" 379 | version = "0.4.2" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | 382 | [[package]] 383 | name = "rand_os" 384 | version = "0.1.3" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | dependencies = [ 387 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 388 | "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 389 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 390 | "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 391 | "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 392 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 393 | ] 394 | 395 | [[package]] 396 | name = "rdrand" 397 | version = "0.4.0" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | dependencies = [ 400 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 401 | ] 402 | 403 | [[package]] 404 | name = "redox_syscall" 405 | version = "0.1.56" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | 408 | [[package]] 409 | name = "redox_users" 410 | version = "0.3.1" 411 | source = "registry+https://github.com/rust-lang/crates.io-index" 412 | dependencies = [ 413 | "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 414 | "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 415 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 416 | "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 417 | ] 418 | 419 | [[package]] 420 | name = "rust-argon2" 421 | version = "0.5.1" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | dependencies = [ 424 | "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 425 | "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", 426 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 427 | ] 428 | 429 | [[package]] 430 | name = "rustc-demangle" 431 | version = "0.1.16" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | 434 | [[package]] 435 | name = "ryu" 436 | version = "1.0.2" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | 439 | [[package]] 440 | name = "serde" 441 | version = "1.0.101" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | 444 | [[package]] 445 | name = "serde_derive" 446 | version = "1.0.101" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | dependencies = [ 449 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 450 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 451 | "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 452 | ] 453 | 454 | [[package]] 455 | name = "serde_json" 456 | version = "1.0.41" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | dependencies = [ 459 | "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", 460 | "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 461 | "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", 462 | ] 463 | 464 | [[package]] 465 | name = "smallvec" 466 | version = "0.6.10" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | 469 | [[package]] 470 | name = "strsim" 471 | version = "0.8.0" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | 474 | [[package]] 475 | name = "syn" 476 | version = "1.0.5" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | dependencies = [ 479 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 480 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 481 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 482 | ] 483 | 484 | [[package]] 485 | name = "synstructure" 486 | version = "0.12.1" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | dependencies = [ 489 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 490 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 491 | "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 492 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 493 | ] 494 | 495 | [[package]] 496 | name = "textwrap" 497 | version = "0.11.0" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | dependencies = [ 500 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 501 | ] 502 | 503 | [[package]] 504 | name = "thread-id" 505 | version = "3.3.0" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | dependencies = [ 508 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 509 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 510 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 511 | ] 512 | 513 | [[package]] 514 | name = "time" 515 | version = "0.1.42" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | dependencies = [ 518 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 519 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 520 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 521 | ] 522 | 523 | [[package]] 524 | name = "unicode-bidi" 525 | version = "0.3.4" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | dependencies = [ 528 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 529 | ] 530 | 531 | [[package]] 532 | name = "unicode-normalization" 533 | version = "0.1.8" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | dependencies = [ 536 | "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", 537 | ] 538 | 539 | [[package]] 540 | name = "unicode-width" 541 | version = "0.1.6" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | 544 | [[package]] 545 | name = "unicode-xid" 546 | version = "0.2.0" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | 549 | [[package]] 550 | name = "url" 551 | version = "2.1.0" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | dependencies = [ 554 | "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 555 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 556 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 557 | ] 558 | 559 | [[package]] 560 | name = "users" 561 | version = "0.9.1" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | dependencies = [ 564 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 565 | ] 566 | 567 | [[package]] 568 | name = "vcpkg" 569 | version = "0.2.7" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | 572 | [[package]] 573 | name = "vec_map" 574 | version = "0.8.1" 575 | source = "registry+https://github.com/rust-lang/crates.io-index" 576 | 577 | [[package]] 578 | name = "wasi" 579 | version = "0.7.0" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | 582 | [[package]] 583 | name = "winapi" 584 | version = "0.3.8" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | dependencies = [ 587 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 588 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 589 | ] 590 | 591 | [[package]] 592 | name = "winapi-i686-pc-windows-gnu" 593 | version = "0.4.0" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | 596 | [[package]] 597 | name = "winapi-x86_64-pc-windows-gnu" 598 | version = "0.4.0" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | 601 | [metadata] 602 | "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 603 | "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" 604 | "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" 605 | "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" 606 | "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 607 | "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" 608 | "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" 609 | "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" 610 | "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 611 | "checksum blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5850aeee1552f495dd0250014cf64b82b7c8879a89d83b33bbdace2cc4f63182" 612 | "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" 613 | "checksum cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c" 614 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 615 | "checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" 616 | "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" 617 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 618 | "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" 619 | "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" 620 | "checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" 621 | "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" 622 | "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" 623 | "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" 624 | "checksum flame 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1fc2706461e1ee94f55cab2ed2e3d34ae9536cfa830358ef80acff1a3dacab30" 625 | "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 626 | "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" 627 | "checksum git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39f27186fbb5ec67ece9a56990292bc5aed3c3fc51b9b07b0b52446b1dfb4a82" 628 | "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 629 | "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" 630 | "checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" 631 | "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" 632 | "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 633 | "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" 634 | "checksum libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a30f8637eb59616ee3b8a00f6adff781ee4ddd8343a615b8238de756060cc1b3" 635 | "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" 636 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 637 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 638 | "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" 639 | "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" 640 | "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" 641 | "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" 642 | "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 643 | "checksum pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "72d5370d90f49f70bd033c3d75e87fc529fbfff9d6f7cccef07d6170079d91ea" 644 | "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" 645 | "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" 646 | "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 647 | "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 648 | "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 649 | "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 650 | "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 651 | "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" 652 | "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" 653 | "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" 654 | "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" 655 | "checksum serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd" 656 | "checksum serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e" 657 | "checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2" 658 | "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" 659 | "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 660 | "checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" 661 | "checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" 662 | "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 663 | "checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" 664 | "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" 665 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 666 | "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" 667 | "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" 668 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 669 | "checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" 670 | "checksum users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c72f4267aea0c3ec6d07eaabea6ead7c5ddacfafc5e22bcf8d186706851fb4cf" 671 | "checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" 672 | "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 673 | "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" 674 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 675 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 676 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 677 | -------------------------------------------------------------------------------- /Cargo.nix: -------------------------------------------------------------------------------- 1 | 2 | # Generated by crate2nix 0.6.0-alpha.0 with the command: 3 | # "generate" 4 | # See https://github.com/kolloch/crate2nix for more info. 5 | 6 | { pkgs? import { config = {}; }, 7 | lib? pkgs.lib, 8 | callPackage? pkgs.callPackage, 9 | stdenv? pkgs.stdenv, 10 | buildRustCrate? pkgs.buildRustCrate, 11 | fetchurl? pkgs.fetchurl, 12 | fetchCrate? pkgs.fetchCrate, 13 | # The features to enable for the root_crate or the workspace_members. 14 | rootFeatures? ["default"]}: 15 | 16 | rec { 17 | # 18 | # "public" attributes that we attempt to keep stable with new versions of crate2nix. 19 | # 20 | 21 | rootCrate = { 22 | packageId = "powerline-rs 0.2.0 (path+file:///home/user/Coding/Rust/powerline-rs)"; 23 | 24 | # Use this attribute to refer to the derivation building your root crate package. 25 | # You can override the features with rootCrate.build.override { features = [ "default" "feature1" ... ]; }. 26 | build = buildRustCrateWithFeatures { 27 | packageId = "powerline-rs 0.2.0 (path+file:///home/user/Coding/Rust/powerline-rs)"; 28 | features = rootFeatures; 29 | }; 30 | }; 31 | root_crate = 32 | builtins.trace "root_crate is deprecated since crate2nix 0.4. Please use rootCrate instead." rootCrate.build; 33 | # Refer your crate build derivation by name here. 34 | # You can override the features with 35 | # workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }. 36 | workspaceMembers = { 37 | "powerline-rs" = { 38 | packageId = "powerline-rs 0.2.0 (path+file:///home/user/Coding/Rust/powerline-rs)"; 39 | build = buildRustCrateWithFeatures { 40 | packageId = "powerline-rs 0.2.0 (path+file:///home/user/Coding/Rust/powerline-rs)"; 41 | features = rootFeatures; 42 | }; 43 | }; 44 | }; 45 | workspace_members = 46 | builtins.trace 47 | "workspace_members is deprecated in crate2nix 0.4. Please use workspaceMembers instead." 48 | lib.mapAttrs (n: v: v.build) workspaceMembers; 49 | 50 | # 51 | # "private" attributes that may change in every new version of crate2nix. 52 | # 53 | 54 | # Build and dependency information for crates. 55 | # Many of the fields are passed one-to-one to buildRustCrate. 56 | # 57 | # Noteworthy: 58 | # * `crateBin = [{name = ","; path = ",";}];`: a hack to disable building the binary. 59 | # * `dependencies`/`buildDependencies`: similar to the corresponding fields for buildRustCrate. 60 | # but with additional information which is used during dependency/feature resolution. 61 | # * `resolvedDependencies`: the selected default features reported by cargo - only included for debugging. 62 | 63 | crates = { 64 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" 65 | = rec { 66 | crateName = "ansi_term"; 67 | version = "0.11.0"; 68 | edition = "2015"; 69 | sha256 = "08fk0p2xvkqpmz3zlrwnf6l8sj2vngw464rvzspzp31sbgxbwm4v"; 70 | authors = [ 71 | "ogham@bsago.me" 72 | "Ryan Scheel (Havvy) " 73 | "Josh Triplett " 74 | ]; 75 | dependencies = { 76 | "winapi" = { 77 | packageId = "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)"; 78 | target = (target."os" == "windows"); 79 | features = [ "errhandlingapi" "consoleapi" "processenv" ]; 80 | }; 81 | }; 82 | features = { 83 | }; 84 | }; 85 | "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" 86 | = rec { 87 | crateName = "arrayref"; 88 | version = "0.3.5"; 89 | edition = "2015"; 90 | sha256 = "00dfn9lbr4pc524imc25v3rbmswiqk3jldsgmx4rdngcpxb8ssjf"; 91 | authors = [ 92 | "David Roundy " 93 | ]; 94 | features = { 95 | }; 96 | }; 97 | "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" 98 | = rec { 99 | crateName = "arrayvec"; 100 | version = "0.4.12"; 101 | edition = "2015"; 102 | sha256 = "0g11if4ihxifdiiwk6brnywkpgbvfbfwxgfqw5a407hprcq3s49f"; 103 | authors = [ 104 | "bluss" 105 | ]; 106 | dependencies = { 107 | "nodrop" = { 108 | packageId = "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)"; 109 | usesDefaultFeatures = false; 110 | }; 111 | }; 112 | features = { 113 | "default" = [ "std" ]; 114 | "serde-1" = [ "serde" ]; 115 | }; 116 | }; 117 | "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" 118 | = rec { 119 | crateName = "atty"; 120 | version = "0.2.13"; 121 | edition = "2015"; 122 | sha256 = "0a1ii8h9fvvrq05bz7j135zjjz1sjz6n2invn2ngxqri0jxgmip2"; 123 | authors = [ 124 | "softprops " 125 | ]; 126 | dependencies = { 127 | "libc" = { 128 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 129 | usesDefaultFeatures = false; 130 | target = target."unix"; 131 | }; 132 | "winapi" = { 133 | packageId = "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)"; 134 | target = target."windows"; 135 | features = [ "consoleapi" "processenv" "minwinbase" "minwindef" "winbase" ]; 136 | }; 137 | }; 138 | features = { 139 | }; 140 | }; 141 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" 142 | = rec { 143 | crateName = "autocfg"; 144 | version = "0.1.7"; 145 | edition = "2015"; 146 | sha256 = "01iq4rs9kanj88pbwjxzqp5k4bgdsvz3y398nljz441rfws11mi4"; 147 | authors = [ 148 | "Josh Stone " 149 | ]; 150 | features = { 151 | }; 152 | }; 153 | "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" 154 | = rec { 155 | crateName = "backtrace"; 156 | version = "0.3.40"; 157 | edition = "2018"; 158 | sha256 = "0xzgw3vldpfcfhsxs17jx3l6vacfxm93g3l363k5vk0nc7avgzar"; 159 | authors = [ 160 | "The Rust Project Developers" 161 | ]; 162 | dependencies = { 163 | "backtrace-sys" = { 164 | packageId = "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)"; 165 | optional = true; 166 | }; 167 | "cfg-if" = "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)"; 168 | "libc" = { 169 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 170 | usesDefaultFeatures = false; 171 | }; 172 | "rustc-demangle" = "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)"; 173 | }; 174 | features = { 175 | "default" = [ "std" "libunwind" "libbacktrace" "dladdr" "dbghelp" ]; 176 | "gimli-symbolize" = [ "addr2line" "findshlibs" "memmap" "goblin" ]; 177 | "libbacktrace" = [ "backtrace-sys" ]; 178 | "rustc-dep-of-std" = [ "backtrace-sys/rustc-dep-of-std" "cfg-if/rustc-dep-of-std" "core" "compiler_builtins" "libc/rustc-dep-of-std" "rustc-demangle/rustc-dep-of-std" ]; 179 | "serialize-rustc" = [ "rustc-serialize" ]; 180 | "serialize-serde" = [ "serde" ]; 181 | "verify-winapi" = [ "winapi/dbghelp" "winapi/handleapi" "winapi/libloaderapi" "winapi/minwindef" "winapi/processthreadsapi" "winapi/synchapi" "winapi/winbase" "winapi/winnt" ]; 182 | }; 183 | resolvedDefaultFeatures = [ "backtrace-sys" "dbghelp" "default" "dladdr" "libbacktrace" "libunwind" "std" ]; 184 | }; 185 | "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" 186 | = rec { 187 | crateName = "backtrace-sys"; 188 | version = "0.1.32"; 189 | edition = "2015"; 190 | sha256 = "1jrb7450v9kyqrjc97vzckbpwj9jakvc1jkq95i46g6mn9kvqkgr"; 191 | authors = [ 192 | "Alex Crichton " 193 | ]; 194 | dependencies = { 195 | "libc" = { 196 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 197 | usesDefaultFeatures = false; 198 | }; 199 | }; 200 | buildDependencies = { 201 | "cc" = "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)"; 202 | }; 203 | features = { 204 | "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; 205 | }; 206 | }; 207 | "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" 208 | = rec { 209 | crateName = "base64"; 210 | version = "0.10.1"; 211 | edition = "2015"; 212 | sha256 = "1zz3jq619hahla1f70ra38818b5n8cp4iilij81i90jq6z7hlfhg"; 213 | authors = [ 214 | "Alice Maz " 215 | "Marshall Pierce " 216 | ]; 217 | dependencies = { 218 | "byteorder" = "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)"; 219 | }; 220 | features = { 221 | }; 222 | }; 223 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" 224 | = rec { 225 | crateName = "bitflags"; 226 | version = "1.2.1"; 227 | edition = "2015"; 228 | sha256 = "0b77awhpn7yaqjjibm69ginfn996azx5vkzfjj39g3wbsqs7mkxg"; 229 | authors = [ 230 | "The Rust Project Developers" 231 | ]; 232 | features = { 233 | }; 234 | resolvedDefaultFeatures = [ "default" ]; 235 | }; 236 | "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" 237 | = rec { 238 | crateName = "blake2b_simd"; 239 | version = "0.5.8"; 240 | edition = "2018"; 241 | sha256 = "14974amxa9lgn8syjp1am4yj4vhmcc27k21bvyz4fsawv3hfv204"; 242 | authors = [ 243 | "Jack O'Connor" 244 | ]; 245 | dependencies = { 246 | "arrayref" = "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)"; 247 | "arrayvec" = { 248 | packageId = "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)"; 249 | usesDefaultFeatures = false; 250 | }; 251 | "constant_time_eq" = "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)"; 252 | }; 253 | features = { 254 | "default" = [ "std" ]; 255 | }; 256 | resolvedDefaultFeatures = [ "default" "std" ]; 257 | }; 258 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" 259 | = rec { 260 | crateName = "byteorder"; 261 | version = "1.3.2"; 262 | edition = "2015"; 263 | sha256 = "099fxwc79ncpcl8dgg9hql8gznz11a3sjs7pai0mg6w8r05khvdx"; 264 | authors = [ 265 | "Andrew Gallant " 266 | ]; 267 | features = { 268 | "default" = [ "std" ]; 269 | }; 270 | resolvedDefaultFeatures = [ "default" "std" ]; 271 | }; 272 | "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" 273 | = rec { 274 | crateName = "cc"; 275 | version = "1.0.46"; 276 | edition = "2018"; 277 | # Hack to suppress building binaries 278 | crateBin = [{name = ","; path = ",";}]; 279 | sha256 = "1r5cp143kvbyxcwna60jxlrjq8sc78sxj912hh01g1g6kkhm7mb6"; 280 | authors = [ 281 | "Alex Crichton " 282 | ]; 283 | dependencies = { 284 | "jobserver" = { 285 | packageId = "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)"; 286 | optional = true; 287 | }; 288 | "num_cpus" = { 289 | packageId = "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)"; 290 | optional = true; 291 | }; 292 | }; 293 | features = { 294 | "parallel" = [ "num_cpus" "jobserver" ]; 295 | }; 296 | resolvedDefaultFeatures = [ "jobserver" "num_cpus" "parallel" ]; 297 | }; 298 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" 299 | = rec { 300 | crateName = "cfg-if"; 301 | version = "0.1.10"; 302 | edition = "2018"; 303 | sha256 = "0x52qzpbyl2f2jqs7kkqzgfki2cpq99gpfjjigdp8pwwfqk01007"; 304 | authors = [ 305 | "Alex Crichton " 306 | ]; 307 | features = { 308 | "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; 309 | }; 310 | }; 311 | "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" 312 | = rec { 313 | crateName = "chrono"; 314 | version = "0.4.9"; 315 | edition = "2015"; 316 | sha256 = "0nw75j1q0idg5a57k68l87422nq8naq818cdxh390byws63a8yfj"; 317 | authors = [ 318 | "Kang Seonghoon " 319 | "Brandon W Maister " 320 | ]; 321 | dependencies = { 322 | "libc" = { 323 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 324 | usesDefaultFeatures = false; 325 | }; 326 | "num-integer" = { 327 | packageId = "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)"; 328 | usesDefaultFeatures = false; 329 | }; 330 | "num-traits" = { 331 | packageId = "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)"; 332 | usesDefaultFeatures = false; 333 | }; 334 | "time" = { 335 | packageId = "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)"; 336 | optional = true; 337 | }; 338 | }; 339 | features = { 340 | "clock" = [ "time" ]; 341 | "default" = [ "clock" ]; 342 | "wasmbind" = [ "wasm-bindgen" "js-sys" ]; 343 | }; 344 | resolvedDefaultFeatures = [ "clock" "default" "time" ]; 345 | }; 346 | "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" 347 | = rec { 348 | crateName = "clap"; 349 | version = "2.33.0"; 350 | edition = "2015"; 351 | sha256 = "054n9ngh6pkknpmd4acgdsp40iw6f5jzq8a4h2b76gnbvk6p5xjh"; 352 | authors = [ 353 | "Kevin K. " 354 | ]; 355 | dependencies = { 356 | "ansi_term" = { 357 | packageId = "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)"; 358 | optional = true; 359 | target = (!target."windows"); 360 | }; 361 | "atty" = { 362 | packageId = "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)"; 363 | optional = true; 364 | }; 365 | "bitflags" = "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)"; 366 | "strsim" = { 367 | packageId = "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)"; 368 | optional = true; 369 | }; 370 | "textwrap" = "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)"; 371 | "unicode-width" = "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)"; 372 | "vec_map" = { 373 | packageId = "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)"; 374 | optional = true; 375 | }; 376 | }; 377 | features = { 378 | "color" = [ "ansi_term" "atty" ]; 379 | "default" = [ "suggestions" "color" "vec_map" ]; 380 | "doc" = [ "yaml" ]; 381 | "lints" = [ "clippy" ]; 382 | "suggestions" = [ "strsim" ]; 383 | "wrap_help" = [ "term_size" "textwrap/term_size" ]; 384 | "yaml" = [ "yaml-rust" ]; 385 | }; 386 | resolvedDefaultFeatures = [ "ansi_term" "atty" "color" "default" "strsim" "suggestions" "vec_map" ]; 387 | }; 388 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" 389 | = rec { 390 | crateName = "cloudabi"; 391 | version = "0.0.3"; 392 | edition = "2015"; 393 | sha256 = "1z9lby5sr6vslfd14d6igk03s7awf91mxpsfmsp3prxbxlk0x7h5"; 394 | libPath = "cloudabi.rs"; 395 | authors = [ 396 | "Nuxi (https://nuxi.nl/) and contributors" 397 | ]; 398 | dependencies = { 399 | "bitflags" = { 400 | packageId = "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)"; 401 | optional = true; 402 | }; 403 | }; 404 | features = { 405 | "default" = [ "bitflags" ]; 406 | }; 407 | resolvedDefaultFeatures = [ "bitflags" "default" ]; 408 | }; 409 | "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" 410 | = rec { 411 | crateName = "constant_time_eq"; 412 | version = "0.1.4"; 413 | edition = "2015"; 414 | sha256 = "0k3b5yavx7si8cy030py6bhgmg24sghzs8chbs4d4r13wjp5c5ih"; 415 | authors = [ 416 | "Cesar Eduardo Barros " 417 | ]; 418 | features = { 419 | }; 420 | }; 421 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" 422 | = rec { 423 | crateName = "crossbeam-utils"; 424 | version = "0.6.6"; 425 | edition = "2015"; 426 | sha256 = "01gxccmrjkkcavdh8fc01kj3b5fmk10f0lkx66jmnv69kcssry72"; 427 | authors = [ 428 | "The Crossbeam Project Developers" 429 | ]; 430 | dependencies = { 431 | "cfg-if" = "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)"; 432 | "lazy_static" = { 433 | packageId = "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)"; 434 | optional = true; 435 | }; 436 | }; 437 | features = { 438 | "default" = [ "std" ]; 439 | "std" = [ "lazy_static" ]; 440 | }; 441 | resolvedDefaultFeatures = [ "default" "lazy_static" "std" ]; 442 | }; 443 | "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" 444 | = rec { 445 | crateName = "dirs"; 446 | version = "2.0.2"; 447 | edition = "2015"; 448 | sha256 = "0zk0kdnl2hd3qk76yq6yk7hc7s73gpnnzi1p208ygrh270y96fpx"; 449 | authors = [ 450 | "Simon Ochsenreither " 451 | ]; 452 | dependencies = { 453 | "cfg-if" = "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)"; 454 | "dirs-sys" = "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)"; 455 | }; 456 | features = { 457 | }; 458 | }; 459 | "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" 460 | = rec { 461 | crateName = "dirs-sys"; 462 | version = "0.3.4"; 463 | edition = "2015"; 464 | sha256 = "1hb7h6g5xyhc26v8d8fksxfw1gv6kl427jzp9vhl7y8v6992d80d"; 465 | authors = [ 466 | "Simon Ochsenreither " 467 | ]; 468 | dependencies = { 469 | "cfg-if" = "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)"; 470 | "libc" = { 471 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 472 | target = target."unix"; 473 | }; 474 | "redox_users" = { 475 | packageId = "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)"; 476 | target = (target."os" == "redox"); 477 | }; 478 | "winapi" = { 479 | packageId = "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)"; 480 | target = target."windows"; 481 | features = [ "knownfolders" "objbase" "shlobj" "winbase" "winerror" ]; 482 | }; 483 | }; 484 | features = { 485 | }; 486 | }; 487 | "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" 488 | = rec { 489 | crateName = "failure"; 490 | version = "0.1.6"; 491 | edition = "2015"; 492 | sha256 = "09qsxzrxzqz7h76sd5klfk6nq407way77j898519ll7pr5yk3j65"; 493 | authors = [ 494 | "Without Boats " 495 | ]; 496 | dependencies = { 497 | "backtrace" = { 498 | packageId = "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)"; 499 | optional = true; 500 | }; 501 | "failure_derive" = { 502 | packageId = "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)"; 503 | optional = true; 504 | }; 505 | }; 506 | features = { 507 | "default" = [ "std" "derive" ]; 508 | "derive" = [ "failure_derive" ]; 509 | "std" = [ "backtrace" ]; 510 | }; 511 | resolvedDefaultFeatures = [ "backtrace" "default" "derive" "failure_derive" "std" ]; 512 | }; 513 | "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" 514 | = rec { 515 | crateName = "failure_derive"; 516 | version = "0.1.6"; 517 | edition = "2015"; 518 | sha256 = "00ps2s591hh2sicdv3ix6gv3qf39n5qf67q0mjff90ha8hvsykpj"; 519 | procMacro = true; 520 | authors = [ 521 | "Without Boats " 522 | ]; 523 | dependencies = { 524 | "proc-macro2" = "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)"; 525 | "quote" = "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)"; 526 | "syn" = "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)"; 527 | "synstructure" = "synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)"; 528 | }; 529 | features = { 530 | }; 531 | }; 532 | "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" 533 | = rec { 534 | crateName = "fuchsia-cprng"; 535 | version = "0.1.1"; 536 | edition = "2018"; 537 | sha256 = "07apwv9dj716yjlcj29p94vkqn5zmfh7hlrqvrjx3wzshphc95h9"; 538 | authors = [ 539 | "Erick Tryzelaar " 540 | ]; 541 | features = { 542 | }; 543 | }; 544 | "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" 545 | = rec { 546 | crateName = "getrandom"; 547 | version = "0.1.12"; 548 | edition = "2018"; 549 | sha256 = "0n3cyf8vm82hbbj6xzgaszjn852i0jl9qxibl7im7mvn7s9yrvb6"; 550 | authors = [ 551 | "The Rand Project Developers" 552 | ]; 553 | dependencies = { 554 | "cfg-if" = "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)"; 555 | "libc" = { 556 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 557 | usesDefaultFeatures = false; 558 | target = (target."unix" || (target."os" == "redox")); 559 | }; 560 | "wasi" = { 561 | packageId = "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)"; 562 | target = (target."os" == "wasi"); 563 | }; 564 | }; 565 | features = { 566 | "rustc-dep-of-std" = [ "compiler_builtins" "core" ]; 567 | }; 568 | }; 569 | "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" 570 | = rec { 571 | crateName = "git2"; 572 | version = "0.10.1"; 573 | edition = "2018"; 574 | sha256 = "18a4n241m34vb1myyh5ysg3608qaz7x72p2cviylk4gp72vk4alq"; 575 | authors = [ 576 | "Josh Triplett " 577 | "Alex Crichton " 578 | ]; 579 | dependencies = { 580 | "bitflags" = "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)"; 581 | "libc" = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 582 | "libgit2-sys" = "libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)"; 583 | "log" = "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)"; 584 | "url" = "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)"; 585 | }; 586 | features = { 587 | "default" = [ "ssh" "https" "ssh_key_from_memory" ]; 588 | "https" = [ "libgit2-sys/https" "openssl-sys" "openssl-probe" ]; 589 | "ssh" = [ "libgit2-sys/ssh" ]; 590 | "ssh_key_from_memory" = [ "libgit2-sys/ssh_key_from_memory" ]; 591 | "vendored-openssl" = [ "openssl-sys/vendored" ]; 592 | }; 593 | }; 594 | "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" 595 | = rec { 596 | crateName = "idna"; 597 | version = "0.2.0"; 598 | edition = "2015"; 599 | sha256 = "1mm05aq43qc5n492njnac5xn4rhiraii25xc0hwppr471jzijh8d"; 600 | authors = [ 601 | "The rust-url developers" 602 | ]; 603 | dependencies = { 604 | "matches" = "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)"; 605 | "unicode-bidi" = "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)"; 606 | "unicode-normalization" = "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)"; 607 | }; 608 | features = { 609 | }; 610 | }; 611 | "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" 612 | = rec { 613 | crateName = "jobserver"; 614 | version = "0.1.17"; 615 | edition = "2015"; 616 | sha256 = "0qazd61l3zgnchzrr9gkvvdzdz1d6g8xrc2skac5qa0ykd1yblyx"; 617 | authors = [ 618 | "Alex Crichton " 619 | ]; 620 | dependencies = { 621 | "getrandom" = { 622 | packageId = "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)"; 623 | target = target."windows"; 624 | }; 625 | "libc" = { 626 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 627 | target = target."unix"; 628 | }; 629 | "log" = "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)"; 630 | }; 631 | features = { 632 | }; 633 | }; 634 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" 635 | = rec { 636 | crateName = "lazy_static"; 637 | version = "1.4.0"; 638 | edition = "2015"; 639 | sha256 = "13h6sdghdcy7vcqsm2gasfw3qg7ssa0fl3sw7lq6pdkbk52wbyfr"; 640 | authors = [ 641 | "Marvin Löbel " 642 | ]; 643 | features = { 644 | "spin_no_std" = [ "spin" ]; 645 | }; 646 | }; 647 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" 648 | = rec { 649 | crateName = "libc"; 650 | version = "0.2.65"; 651 | edition = "2015"; 652 | sha256 = "0nx1n3xvwj2ikw1d6v17154jx2sb9sgrv6fwbnq79c614a3mhmad"; 653 | authors = [ 654 | "The Rust Project Developers" 655 | ]; 656 | features = { 657 | "default" = [ "std" ]; 658 | "rustc-dep-of-std" = [ "align" "rustc-std-workspace-core" ]; 659 | "use_std" = [ "std" ]; 660 | }; 661 | resolvedDefaultFeatures = [ "default" "std" ]; 662 | }; 663 | "libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" 664 | = rec { 665 | crateName = "libgit2-sys"; 666 | version = "0.9.1"; 667 | edition = "2018"; 668 | sha256 = "08cc5k5w9h1gp411lgnz3q7n3bhl4vq6a54bbnalwqqx9i4scb6x"; 669 | libName = "libgit2_sys"; 670 | libPath = "lib.rs"; 671 | authors = [ 672 | "Josh Triplett " 673 | "Alex Crichton " 674 | ]; 675 | dependencies = { 676 | "libc" = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 677 | "libz-sys" = "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)"; 678 | }; 679 | buildDependencies = { 680 | "cc" = { 681 | packageId = "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)"; 682 | features = [ "parallel" ]; 683 | }; 684 | "pkg-config" = "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)"; 685 | }; 686 | features = { 687 | "https" = [ "openssl-sys" ]; 688 | "ssh" = [ "libssh2-sys" ]; 689 | }; 690 | }; 691 | "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" 692 | = rec { 693 | crateName = "libz-sys"; 694 | version = "1.0.25"; 695 | edition = "2015"; 696 | sha256 = "195jzg8mgjbvmkbpx1rzkzrqm0g2fdivk79v44c9lzl64r3f9fym"; 697 | authors = [ 698 | "Alex Crichton " 699 | ]; 700 | dependencies = { 701 | "libc" = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 702 | }; 703 | buildDependencies = { 704 | "cc" = "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)"; 705 | "pkg-config" = "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)"; 706 | "vcpkg" = { 707 | packageId = "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)"; 708 | target = (target."env" == "msvc"); 709 | }; 710 | }; 711 | features = { 712 | }; 713 | }; 714 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" 715 | = rec { 716 | crateName = "log"; 717 | version = "0.4.8"; 718 | edition = "2015"; 719 | sha256 = "0wvzzzcn89dai172rrqcyz06pzldyyy0lf0w71csmn206rdpnb15"; 720 | authors = [ 721 | "The Rust Project Developers" 722 | ]; 723 | dependencies = { 724 | "cfg-if" = "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)"; 725 | }; 726 | features = { 727 | "kv_unstable_sval" = [ "kv_unstable" "sval/fmt" ]; 728 | }; 729 | }; 730 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" 731 | = rec { 732 | crateName = "matches"; 733 | version = "0.1.8"; 734 | edition = "2015"; 735 | sha256 = "03hl636fg6xggy0a26200xs74amk3k9n0908rga2szn68agyz3cv"; 736 | libPath = "lib.rs"; 737 | authors = [ 738 | "Simon Sapin " 739 | ]; 740 | features = { 741 | }; 742 | }; 743 | "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" 744 | = rec { 745 | crateName = "nodrop"; 746 | version = "0.1.14"; 747 | edition = "2015"; 748 | sha256 = "0b4adir378n2irr76z8grc9jxif8vlyy01rid8j4r716y9y4dg9r"; 749 | authors = [ 750 | "bluss" 751 | ]; 752 | features = { 753 | "default" = [ "std" ]; 754 | "use_union" = [ "nodrop-union" ]; 755 | }; 756 | }; 757 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" 758 | = rec { 759 | crateName = "num-integer"; 760 | version = "0.1.41"; 761 | edition = "2015"; 762 | sha256 = "1y45nh9xlp2dra9svb1wfsy65fysm3k1w4m8jynywccq645yixid"; 763 | authors = [ 764 | "The Rust Project Developers" 765 | ]; 766 | dependencies = { 767 | "num-traits" = { 768 | packageId = "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)"; 769 | usesDefaultFeatures = false; 770 | }; 771 | }; 772 | buildDependencies = { 773 | "autocfg" = "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)"; 774 | }; 775 | features = { 776 | "default" = [ "std" ]; 777 | "i128" = [ "num-traits/i128" ]; 778 | "std" = [ "num-traits/std" ]; 779 | }; 780 | }; 781 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" 782 | = rec { 783 | crateName = "num-traits"; 784 | version = "0.2.8"; 785 | edition = "2015"; 786 | sha256 = "1mnlmy35n734n9xlq0qkfbgzz33x09a1s4rfj30p1976p09b862v"; 787 | authors = [ 788 | "The Rust Project Developers" 789 | ]; 790 | buildDependencies = { 791 | "autocfg" = "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)"; 792 | }; 793 | features = { 794 | "default" = [ "std" ]; 795 | }; 796 | }; 797 | "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" 798 | = rec { 799 | crateName = "num_cpus"; 800 | version = "1.10.1"; 801 | edition = "2015"; 802 | sha256 = "1zi5s2cbnqqb0k0kdd6gqn2x97f9bssv44430h6w28awwzppyh8i"; 803 | authors = [ 804 | "Sean McArthur " 805 | ]; 806 | dependencies = { 807 | "libc" = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 808 | }; 809 | features = { 810 | }; 811 | }; 812 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" 813 | = rec { 814 | crateName = "percent-encoding"; 815 | version = "2.1.0"; 816 | edition = "2015"; 817 | sha256 = "0i838f2nr81585ckmfymf8l1x1vdmx6n8xqvli0lgcy60yl2axy3"; 818 | libPath = "lib.rs"; 819 | authors = [ 820 | "The rust-url developers" 821 | ]; 822 | features = { 823 | }; 824 | }; 825 | "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" 826 | = rec { 827 | crateName = "pkg-config"; 828 | version = "0.3.16"; 829 | edition = "2015"; 830 | sha256 = "1a2gg5a9l74brz1vzkkzfl8aihd7b4rk3vhbmiahkmpzavywza5j"; 831 | authors = [ 832 | "Alex Crichton " 833 | ]; 834 | features = { 835 | }; 836 | }; 837 | "powerline-rs 0.2.0 (path+file:///home/user/Coding/Rust/powerline-rs)" 838 | = rec { 839 | crateName = "powerline-rs"; 840 | version = "0.2.0"; 841 | edition = "2018"; 842 | src = (builtins.filterSource sourceFilter ./.); 843 | authors = [ 844 | "jD91mZM2 " 845 | ]; 846 | dependencies = { 847 | "chrono" = { 848 | packageId = "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)"; 849 | optional = true; 850 | }; 851 | "clap" = "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)"; 852 | "dirs" = "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)"; 853 | "git2" = { 854 | packageId = "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)"; 855 | optional = true; 856 | usesDefaultFeatures = false; 857 | }; 858 | "users" = { 859 | packageId = "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)"; 860 | optional = true; 861 | }; 862 | }; 863 | buildDependencies = { 864 | "clap" = "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)"; 865 | }; 866 | features = { 867 | "default" = [ "chrono" "git2" "users" ]; 868 | }; 869 | resolvedDefaultFeatures = [ "chrono" "default" "git2" "users" ]; 870 | }; 871 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" 872 | = rec { 873 | crateName = "proc-macro2"; 874 | version = "1.0.6"; 875 | edition = "2018"; 876 | sha256 = "1l56ss9ip8cg6764cpi9y8dv7nsyqf2i4hb7sn29zx61n03jr81z"; 877 | authors = [ 878 | "Alex Crichton " 879 | ]; 880 | dependencies = { 881 | "unicode-xid" = "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)"; 882 | }; 883 | features = { 884 | "default" = [ "proc-macro" ]; 885 | }; 886 | resolvedDefaultFeatures = [ "default" "proc-macro" ]; 887 | }; 888 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" 889 | = rec { 890 | crateName = "quote"; 891 | version = "1.0.2"; 892 | edition = "2018"; 893 | sha256 = "0r7030w7dymarn92gjgm02hsm04fwsfs6f1l20wdqiyrm9z8rs5q"; 894 | authors = [ 895 | "David Tolnay " 896 | ]; 897 | dependencies = { 898 | "proc-macro2" = { 899 | packageId = "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)"; 900 | usesDefaultFeatures = false; 901 | }; 902 | }; 903 | features = { 904 | "default" = [ "proc-macro" ]; 905 | "proc-macro" = [ "proc-macro2/proc-macro" ]; 906 | }; 907 | resolvedDefaultFeatures = [ "default" "proc-macro" ]; 908 | }; 909 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" 910 | = rec { 911 | crateName = "rand_core"; 912 | version = "0.3.1"; 913 | edition = "2015"; 914 | sha256 = "0q0ssgpj9x5a6fda83nhmfydy7a6c0wvxm0jhncsmjx8qp8gw91m"; 915 | authors = [ 916 | "The Rand Project Developers" 917 | "The Rust Project Developers" 918 | ]; 919 | dependencies = { 920 | "rand_core" = "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)"; 921 | }; 922 | features = { 923 | "alloc" = [ "rand_core/alloc" ]; 924 | "default" = [ "std" ]; 925 | "serde1" = [ "rand_core/serde1" ]; 926 | "std" = [ "rand_core/std" ]; 927 | }; 928 | }; 929 | "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" 930 | = rec { 931 | crateName = "rand_core"; 932 | version = "0.4.2"; 933 | edition = "2015"; 934 | sha256 = "18zpzwn4bl7lp9f36iacy8mvdnfrhfmzsl35gmln98dcindff2ly"; 935 | authors = [ 936 | "The Rand Project Developers" 937 | "The Rust Project Developers" 938 | ]; 939 | features = { 940 | "serde1" = [ "serde" "serde_derive" ]; 941 | "std" = [ "alloc" ]; 942 | }; 943 | resolvedDefaultFeatures = [ "alloc" "std" ]; 944 | }; 945 | "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" 946 | = rec { 947 | crateName = "rand_os"; 948 | version = "0.1.3"; 949 | edition = "2015"; 950 | sha256 = "0ywwspizgs9g8vzn6m5ix9yg36n15119d6n792h7mk4r5vs0ww4j"; 951 | authors = [ 952 | "The Rand Project Developers" 953 | ]; 954 | dependencies = { 955 | "cloudabi" = { 956 | packageId = "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)"; 957 | target = (target."os" == "cloudabi"); 958 | }; 959 | "fuchsia-cprng" = { 960 | packageId = "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)"; 961 | target = (target."os" == "fuchsia"); 962 | }; 963 | "libc" = { 964 | packageId = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 965 | target = target."unix"; 966 | }; 967 | "rand_core" = { 968 | packageId = "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)"; 969 | features = [ "std" ]; 970 | }; 971 | "rdrand" = { 972 | packageId = "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)"; 973 | target = (target."env" == "sgx"); 974 | }; 975 | "winapi" = { 976 | packageId = "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)"; 977 | target = target."windows"; 978 | features = [ "minwindef" "ntsecapi" "winnt" ]; 979 | }; 980 | }; 981 | features = { 982 | }; 983 | }; 984 | "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" 985 | = rec { 986 | crateName = "rdrand"; 987 | version = "0.4.0"; 988 | edition = "2015"; 989 | sha256 = "15hrcasn0v876wpkwab1dwbk9kvqwrb3iv4y4dibb6yxnfvzwajk"; 990 | authors = [ 991 | "Simonas Kazlauskas " 992 | ]; 993 | dependencies = { 994 | "rand_core" = { 995 | packageId = "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)"; 996 | usesDefaultFeatures = false; 997 | }; 998 | }; 999 | features = { 1000 | "default" = [ "std" ]; 1001 | }; 1002 | resolvedDefaultFeatures = [ "default" "std" ]; 1003 | }; 1004 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" 1005 | = rec { 1006 | crateName = "redox_syscall"; 1007 | version = "0.1.56"; 1008 | edition = "2015"; 1009 | sha256 = "0jcp8nd947zcy938bz09pzlmi3vyxfdzg92pjxdvvk0699vwcc26"; 1010 | libName = "syscall"; 1011 | authors = [ 1012 | "Jeremy Soller " 1013 | ]; 1014 | features = { 1015 | }; 1016 | }; 1017 | "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" 1018 | = rec { 1019 | crateName = "redox_users"; 1020 | version = "0.3.1"; 1021 | edition = "2015"; 1022 | sha256 = "0kqc1vjmkcvgkxjpqva3nyqd9dixivsh4qswxclyqf7ql8a2g17s"; 1023 | authors = [ 1024 | "Jose Narvaez " 1025 | "Wesley Hershberger " 1026 | ]; 1027 | dependencies = { 1028 | "failure" = "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)"; 1029 | "rand_os" = "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)"; 1030 | "redox_syscall" = "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)"; 1031 | "rust-argon2" = "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)"; 1032 | }; 1033 | features = { 1034 | }; 1035 | }; 1036 | "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" 1037 | = rec { 1038 | crateName = "rust-argon2"; 1039 | version = "0.5.1"; 1040 | edition = "2015"; 1041 | sha256 = "049dqwn63i6xix55cnh8n4iqm2d3yzpisfsc2568vfmaaa4866d2"; 1042 | libName = "argon2"; 1043 | authors = [ 1044 | "Martijn Rijkeboer " 1045 | ]; 1046 | dependencies = { 1047 | "base64" = "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)"; 1048 | "blake2b_simd" = "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)"; 1049 | "crossbeam-utils" = "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)"; 1050 | }; 1051 | features = { 1052 | }; 1053 | }; 1054 | "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" 1055 | = rec { 1056 | crateName = "rustc-demangle"; 1057 | version = "0.1.16"; 1058 | edition = "2015"; 1059 | sha256 = "0zmn448d0f898ahfkz7cir0fi0vk84dabjpw84mk6a1r6nf9vzmi"; 1060 | authors = [ 1061 | "Alex Crichton " 1062 | ]; 1063 | features = { 1064 | "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; 1065 | }; 1066 | }; 1067 | "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" 1068 | = rec { 1069 | crateName = "smallvec"; 1070 | version = "0.6.10"; 1071 | edition = "2015"; 1072 | sha256 = "01w7xd79q0bwn683gk4ryw50ad1zzxkny10f7gkbaaj1ax6f4q4h"; 1073 | libPath = "lib.rs"; 1074 | authors = [ 1075 | "Simon Sapin " 1076 | ]; 1077 | features = { 1078 | "default" = [ "std" ]; 1079 | }; 1080 | resolvedDefaultFeatures = [ "default" "std" ]; 1081 | }; 1082 | "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" 1083 | = rec { 1084 | crateName = "strsim"; 1085 | version = "0.8.0"; 1086 | edition = "2015"; 1087 | sha256 = "0d3jsdz22wgjyxdakqnvdgmwjdvkximz50d9zfk4qlalw635qcvy"; 1088 | authors = [ 1089 | "Danny Guo " 1090 | ]; 1091 | features = { 1092 | }; 1093 | }; 1094 | "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" 1095 | = rec { 1096 | crateName = "syn"; 1097 | version = "1.0.5"; 1098 | edition = "2018"; 1099 | sha256 = "08qbk425r8c4q4rrpq1q9wkd3v3bji8nlfaxj8v4l7lkpjkh0xgs"; 1100 | authors = [ 1101 | "David Tolnay " 1102 | ]; 1103 | dependencies = { 1104 | "proc-macro2" = { 1105 | packageId = "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)"; 1106 | usesDefaultFeatures = false; 1107 | }; 1108 | "quote" = { 1109 | packageId = "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)"; 1110 | optional = true; 1111 | usesDefaultFeatures = false; 1112 | }; 1113 | "unicode-xid" = "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)"; 1114 | }; 1115 | features = { 1116 | "default" = [ "derive" "parsing" "printing" "clone-impls" "proc-macro" ]; 1117 | "printing" = [ "quote" ]; 1118 | "proc-macro" = [ "proc-macro2/proc-macro" "quote/proc-macro" ]; 1119 | }; 1120 | resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "extra-traits" "parsing" "printing" "proc-macro" "quote" "visit" ]; 1121 | }; 1122 | "synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" 1123 | = rec { 1124 | crateName = "synstructure"; 1125 | version = "0.12.1"; 1126 | edition = "2018"; 1127 | sha256 = "19r76q37zdz4ja37s4gnq317liqnamawydgkz240ak9h4pzm95wc"; 1128 | authors = [ 1129 | "Nika Layzell " 1130 | ]; 1131 | dependencies = { 1132 | "proc-macro2" = "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)"; 1133 | "quote" = "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)"; 1134 | "syn" = { 1135 | packageId = "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)"; 1136 | features = [ "visit" "extra-traits" ]; 1137 | }; 1138 | "unicode-xid" = "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)"; 1139 | }; 1140 | features = { 1141 | }; 1142 | }; 1143 | "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" 1144 | = rec { 1145 | crateName = "textwrap"; 1146 | version = "0.11.0"; 1147 | edition = "2015"; 1148 | sha256 = "0s25qh49n7kjayrdj4q3v0jk0jc6vy88rdw0bvgfxqlscpqpxi7d"; 1149 | authors = [ 1150 | "Martin Geisler " 1151 | ]; 1152 | dependencies = { 1153 | "unicode-width" = "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)"; 1154 | }; 1155 | features = { 1156 | }; 1157 | }; 1158 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" 1159 | = rec { 1160 | crateName = "time"; 1161 | version = "0.1.42"; 1162 | edition = "2015"; 1163 | sha256 = "1ny809kmdjwd4b478ipc33dz7q6nq7rxk766x8cnrg6zygcksmmx"; 1164 | authors = [ 1165 | "The Rust Project Developers" 1166 | ]; 1167 | dependencies = { 1168 | "libc" = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 1169 | "redox_syscall" = { 1170 | packageId = "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)"; 1171 | target = (target."os" == "redox"); 1172 | }; 1173 | "winapi" = { 1174 | packageId = "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)"; 1175 | target = target."windows"; 1176 | features = [ "std" "minwinbase" "minwindef" "ntdef" "profileapi" "sysinfoapi" "timezoneapi" ]; 1177 | }; 1178 | }; 1179 | features = { 1180 | }; 1181 | }; 1182 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" 1183 | = rec { 1184 | crateName = "unicode-bidi"; 1185 | version = "0.3.4"; 1186 | edition = "2015"; 1187 | sha256 = "0lcd6jasrf8p9p0q20qyf10c6xhvw40m2c4rr105hbk6zy26nj1q"; 1188 | libName = "unicode_bidi"; 1189 | authors = [ 1190 | "The Servo Project Developers" 1191 | ]; 1192 | dependencies = { 1193 | "matches" = "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)"; 1194 | }; 1195 | features = { 1196 | "flame_it" = [ "flame" "flamer" ]; 1197 | "with_serde" = [ "serde" ]; 1198 | }; 1199 | resolvedDefaultFeatures = [ "default" ]; 1200 | }; 1201 | "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" 1202 | = rec { 1203 | crateName = "unicode-normalization"; 1204 | version = "0.1.8"; 1205 | edition = "2015"; 1206 | sha256 = "1pb26i2xd5zz0icabyqahikpca0iwj2jd4145pczc4bb7p641dsz"; 1207 | authors = [ 1208 | "kwantam " 1209 | ]; 1210 | dependencies = { 1211 | "smallvec" = "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)"; 1212 | }; 1213 | features = { 1214 | }; 1215 | }; 1216 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" 1217 | = rec { 1218 | crateName = "unicode-width"; 1219 | version = "0.1.6"; 1220 | edition = "2015"; 1221 | sha256 = "1mss965j7d8pv7z7zg6qfkcb7lyhxkxvbh8akzr4xxxx3vzazwsi"; 1222 | authors = [ 1223 | "kwantam " 1224 | ]; 1225 | features = { 1226 | "rustc-dep-of-std" = [ "std" "core" "compiler_builtins" ]; 1227 | }; 1228 | resolvedDefaultFeatures = [ "default" ]; 1229 | }; 1230 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" 1231 | = rec { 1232 | crateName = "unicode-xid"; 1233 | version = "0.2.0"; 1234 | edition = "2015"; 1235 | sha256 = "1c85gb3p3qhbjvfyjb31m06la4f024jx319k10ig7n47dz2fk8v7"; 1236 | authors = [ 1237 | "erick.tryzelaar " 1238 | "kwantam " 1239 | ]; 1240 | features = { 1241 | }; 1242 | resolvedDefaultFeatures = [ "default" ]; 1243 | }; 1244 | "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" 1245 | = rec { 1246 | crateName = "url"; 1247 | version = "2.1.0"; 1248 | edition = "2015"; 1249 | sha256 = "0mvv28fvrrv3hc064gjgpqjvjn1j151qbi9i5bcilal6rkcd1brq"; 1250 | authors = [ 1251 | "The rust-url developers" 1252 | ]; 1253 | dependencies = { 1254 | "idna" = "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)"; 1255 | "matches" = "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)"; 1256 | "percent-encoding" = "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)"; 1257 | }; 1258 | features = { 1259 | }; 1260 | }; 1261 | "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" 1262 | = rec { 1263 | crateName = "users"; 1264 | version = "0.9.1"; 1265 | edition = "2015"; 1266 | sha256 = "0k5fc6hq7qmanfrvllij6qqmk9m9h8zmk17gwhcyz1dv11f6hy21"; 1267 | authors = [ 1268 | "Benjamin Sago " 1269 | ]; 1270 | dependencies = { 1271 | "libc" = "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)"; 1272 | }; 1273 | features = { 1274 | "default" = [ "cache" "mock" ]; 1275 | }; 1276 | resolvedDefaultFeatures = [ "cache" "default" "mock" ]; 1277 | }; 1278 | "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" 1279 | = rec { 1280 | crateName = "vcpkg"; 1281 | version = "0.2.7"; 1282 | edition = "2015"; 1283 | sha256 = "1lwykbbscbdy4nhrfidgg3rk2xw9cvx5672sx1c97wm8y3vjpcd9"; 1284 | authors = [ 1285 | "Jim McGrath " 1286 | ]; 1287 | features = { 1288 | }; 1289 | }; 1290 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" 1291 | = rec { 1292 | crateName = "vec_map"; 1293 | version = "0.8.1"; 1294 | edition = "2015"; 1295 | sha256 = "1jj2nrg8h3l53d43rwkpkikq5a5x15ms4rf1rw92hp5lrqhi8mpi"; 1296 | authors = [ 1297 | "Alex Crichton " 1298 | "Jorge Aparicio " 1299 | "Alexis Beingessner " 1300 | "Brian Anderson <>" 1301 | "tbu- <>" 1302 | "Manish Goregaokar <>" 1303 | "Aaron Turon " 1304 | "Adolfo Ochagavía <>" 1305 | "Niko Matsakis <>" 1306 | "Steven Fackler <>" 1307 | "Chase Southwood " 1308 | "Eduard Burtescu <>" 1309 | "Florian Wilkens <>" 1310 | "Félix Raimundo <>" 1311 | "Tibor Benke <>" 1312 | "Markus Siemens " 1313 | "Josh Branchaud " 1314 | "Huon Wilson " 1315 | "Corey Farwell " 1316 | "Aaron Liblong <>" 1317 | "Nick Cameron " 1318 | "Patrick Walton " 1319 | "Felix S Klock II <>" 1320 | "Andrew Paseltiner " 1321 | "Sean McArthur " 1322 | "Vadim Petrochenkov <>" 1323 | ]; 1324 | features = { 1325 | "eders" = [ "serde" ]; 1326 | }; 1327 | }; 1328 | "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" 1329 | = rec { 1330 | crateName = "wasi"; 1331 | version = "0.7.0"; 1332 | edition = "2018"; 1333 | sha256 = "1lqknxy8x9mrsy0pna6xlwzypbhli73nbai9gmin5f4z1ghlng25"; 1334 | authors = [ 1335 | "The Cranelift Project Developers" 1336 | ]; 1337 | features = { 1338 | "default" = [ "alloc" ]; 1339 | "rustc-dep-of-std" = [ "compiler_builtins" "core" "rustc-std-workspace-alloc" ]; 1340 | }; 1341 | resolvedDefaultFeatures = [ "alloc" "default" ]; 1342 | }; 1343 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" 1344 | = rec { 1345 | crateName = "winapi"; 1346 | version = "0.3.8"; 1347 | edition = "2015"; 1348 | sha256 = "084ialbgww1vxry341fmkg5crgpvab3w52ahx1wa54yqjgym0vxs"; 1349 | authors = [ 1350 | "Peter Atashian " 1351 | ]; 1352 | dependencies = { 1353 | "winapi-i686-pc-windows-gnu" = { 1354 | packageId = "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)"; 1355 | target = (stdenv.hostPlatform.config == "i686-pc-windows-gnu"); 1356 | }; 1357 | "winapi-x86_64-pc-windows-gnu" = { 1358 | packageId = "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)"; 1359 | target = (stdenv.hostPlatform.config == "x86_64-pc-windows-gnu"); 1360 | }; 1361 | }; 1362 | features = { 1363 | "debug" = [ "impl-debug" ]; 1364 | }; 1365 | resolvedDefaultFeatures = [ "consoleapi" "errhandlingapi" "knownfolders" "minwinbase" "minwindef" "ntdef" "ntsecapi" "objbase" "processenv" "profileapi" "shlobj" "std" "sysinfoapi" "timezoneapi" "winbase" "winerror" "winnt" ]; 1366 | }; 1367 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" 1368 | = rec { 1369 | crateName = "winapi-i686-pc-windows-gnu"; 1370 | version = "0.4.0"; 1371 | edition = "2015"; 1372 | sha256 = "05ihkij18r4gamjpxj4gra24514can762imjzlmak5wlzidplzrp"; 1373 | authors = [ 1374 | "Peter Atashian " 1375 | ]; 1376 | features = { 1377 | }; 1378 | }; 1379 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" 1380 | = rec { 1381 | crateName = "winapi-x86_64-pc-windows-gnu"; 1382 | version = "0.4.0"; 1383 | edition = "2015"; 1384 | sha256 = "0n1ylmlsb8yg1v583i4xy0qmqg42275flvbc51hdqjjfjcl9vlbj"; 1385 | authors = [ 1386 | "Peter Atashian " 1387 | ]; 1388 | features = { 1389 | }; 1390 | }; 1391 | }; 1392 | 1393 | # 1394 | # crate2nix/default.nix (excerpt start) 1395 | # 1396 | 1397 | # Target (platform) data for conditional dependencies. 1398 | # This corresponds to what buildRustCrate is setting. 1399 | target = { 1400 | unix = true; 1401 | windows = false; 1402 | 1403 | # This doesn't appear to be officially documented anywhere yet. 1404 | # See https://github.com/rust-lang-nursery/rust-forge/issues/101. 1405 | os = if stdenv.hostPlatform.isDarwin 1406 | then "macos" 1407 | else stdenv.hostPlatform.parsed.kernel.name; 1408 | arch = stdenv.hostPlatform.parsed.cpu.name; 1409 | family = "unix"; 1410 | env = "gnu"; 1411 | endian = if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"; 1412 | pointer_width = toString stdenv.hostPlatform.parsed.cpu.bits; 1413 | vendor = stdenv.hostPlatform.parsed.vendor.name; 1414 | debug_assertions = false; 1415 | }; 1416 | 1417 | /* Filters common temp files and build files */ 1418 | # TODO(pkolloch): Substitute with gitignore filter 1419 | sourceFilter = name: type: 1420 | let baseName = builtins.baseNameOf (builtins.toString name); 1421 | in ! ( 1422 | # Filter out git 1423 | baseName == ".gitignore" || 1424 | (type == "directory" && baseName == ".git" ) || 1425 | 1426 | # Filter out build results 1427 | (type == "directory" && ( 1428 | baseName == "target" || 1429 | baseName == "_site" || 1430 | baseName == ".sass-cache" || 1431 | baseName == ".jekyll-metadata" || 1432 | baseName == "build-artifacts" 1433 | )) || 1434 | 1435 | # Filter out nix-build result symlinks 1436 | (type == "symlink" && lib.hasPrefix "result" baseName) || 1437 | 1438 | # Filter out IDE config 1439 | (type == "directory" && ( 1440 | baseName == ".idea" || 1441 | baseName == ".vscode" 1442 | )) || 1443 | lib.hasSuffix ".iml" baseName || 1444 | 1445 | # Filter out nix build files 1446 | # lib.hasSuffix ".nix" baseName || 1447 | 1448 | # Filter out editor backup / swap files. 1449 | lib.hasSuffix "~" baseName || 1450 | builtins.match "^\\.sw[a-z]$$" baseName != null || 1451 | builtins.match "^\\..*\\.sw[a-z]$$" baseName != null || 1452 | lib.hasSuffix ".tmp" baseName || 1453 | lib.hasSuffix ".bak" baseName || 1454 | baseName == "tests.nix" 1455 | ); 1456 | 1457 | /* A restricted overridable version of buildRustCrateWithFeaturesImpl. */ 1458 | buildRustCrateWithFeatures = {packageId, features}: 1459 | lib.makeOverridable 1460 | ({features}: buildRustCrateWithFeaturesImpl {inherit packageId features;}) 1461 | { inherit features; }; 1462 | 1463 | /* Returns a buildRustCrate derivation for the given packageId and features. */ 1464 | buildRustCrateWithFeaturesImpl = { crateConfigs? crates, packageId, features } @ args: 1465 | assert (builtins.isAttrs crateConfigs); 1466 | assert (builtins.isString packageId); 1467 | assert (builtins.isList features); 1468 | 1469 | let mergedFeatures = mergePackageFeatures args; 1470 | buildByPackageId = packageId: 1471 | let features = mergedFeatures."${packageId}" or []; 1472 | crateConfig = lib.filterAttrs (n: v: n != "resolvedDefaultFeatures") crateConfigs."${packageId}"; 1473 | dependencies = 1474 | dependencyDerivations buildByPackageId features (crateConfig.dependencies or {}); 1475 | buildDependencies = 1476 | dependencyDerivations buildByPackageId features (crateConfig.buildDependencies or {}); 1477 | dependenciesWithRenames = 1478 | lib.filterAttrs (n: v: v ? "rename") 1479 | (crateConfig.buildDependencies or {} // crateConfig.dependencies or {}); 1480 | crateRenames = 1481 | lib.mapAttrs (name: value: value.rename or name) dependenciesWithRenames; 1482 | in buildRustCrate (crateConfig // { inherit features dependencies buildDependencies crateRenames; }); 1483 | in buildByPackageId packageId; 1484 | 1485 | /* Returns the actual derivations for the given dependencies. */ 1486 | dependencyDerivations = buildByPackageId: features: dependencies: 1487 | assert (builtins.isFunction buildByPackageId); 1488 | assert (builtins.isList features); 1489 | assert (builtins.isAttrs dependencies); 1490 | 1491 | let enabledDependencies = filterEnabledDependencies dependencies features; 1492 | depDerivation = dependencyName: dependency: 1493 | buildByPackageId (dependencyPackageId dependency); 1494 | in builtins.attrValues (lib.mapAttrs depDerivation enabledDependencies); 1495 | 1496 | /* Returns differences between cargo default features and crate2nix default features. 1497 | * 1498 | * This is useful for verifying the feature resolution in crate2nix. 1499 | */ 1500 | diffDefaultPackageFeatures = {crateConfigs ? crates, packageId}: 1501 | assert (builtins.isAttrs crateConfigs); 1502 | 1503 | let prefixValues = prefix: lib.mapAttrs (n: v: { "${prefix}" = v; }); 1504 | mergedFeatures = 1505 | prefixValues 1506 | "crate2nix" 1507 | (mergePackageFeatures {inherit crateConfigs packageId; features = ["default"]; }); 1508 | configs = prefixValues "cargo" crateConfigs; 1509 | combined = lib.foldAttrs (a: b: a // b) {} [ mergedFeatures configs ]; 1510 | onlyInCargo = builtins.attrNames (lib.filterAttrs (n: v: !(v ? "crate2nix" ) && (v ? "cargo")) combined); 1511 | onlyInCrate2Nix = builtins.attrNames (lib.filterAttrs (n: v: (v ? "crate2nix" ) && !(v ? "cargo")) combined); 1512 | differentFeatures = lib.filterAttrs 1513 | (n: v: 1514 | (v ? "crate2nix" ) 1515 | && (v ? "cargo") 1516 | && (v.crate2nix.features or []) != (v."cargo".resolved_default_features or [])) 1517 | combined; 1518 | in builtins.toJSON { inherit onlyInCargo onlyInCrate2Nix differentFeatures; }; 1519 | 1520 | /* Returns the feature configuration by package id for the given input crate. */ 1521 | mergePackageFeatures = {crateConfigs ? crates, packageId, features} @ args: 1522 | assert (builtins.isAttrs crateConfigs); 1523 | assert (builtins.isString packageId); 1524 | assert (builtins.isList features); 1525 | 1526 | let packageFeatures = listOfPackageFeatures args; 1527 | grouped = lib.groupBy (x: x.packageId) packageFeatures; 1528 | in lib.mapAttrs (n: v: sortedUnique (builtins.concatLists (builtins.map (v: v.features) v))) grouped; 1529 | 1530 | /* Returns a { packageId, features } attribute set for every package needed for building the 1531 | package for the given packageId with the given features. 1532 | 1533 | Returns multiple, potentially conflicting attribute sets for dependencies that are reachable 1534 | by multiple paths in the dependency tree. 1535 | */ 1536 | listOfPackageFeatures = {crateConfigs ? crates, packageId, features, dependencyPath? [packageId]} @ args: 1537 | assert (builtins.isAttrs crateConfigs); 1538 | assert (builtins.isString packageId); 1539 | assert (builtins.isList features); 1540 | 1541 | let 1542 | crateConfig = crateConfigs."${packageId}" or (builtins.throw "Package not found: ${packageId}"); 1543 | expandedFeatures = expandFeatures (crateConfig.features or {}) features; 1544 | 1545 | depWithResolvedFeatures = dependencyName: dependency: 1546 | let packageId = dependencyPackageId dependency; 1547 | features = dependencyFeatures expandedFeatures dependencyName dependency; 1548 | in { inherit packageId features; }; 1549 | 1550 | resolveDependencies = path: dependencies: 1551 | assert (builtins.isAttrs dependencies); 1552 | 1553 | let enabledDependencies = filterEnabledDependencies dependencies expandedFeatures; 1554 | directDependencies = 1555 | builtins.attrValues (lib.mapAttrs depWithResolvedFeatures enabledDependencies); 1556 | in builtins.concatMap 1557 | ({packageId, features}: listOfPackageFeatures { 1558 | # This is purely for debugging. 1559 | dependencyPath = dependencyPath ++ [path packageId]; 1560 | inherit crateConfigs packageId features; 1561 | }) 1562 | directDependencies; 1563 | 1564 | resolvedDependencies = builtins.concatLists 1565 | [ 1566 | (resolveDependencies "dependencies" (crateConfig.dependencies or {})) 1567 | (resolveDependencies "buildDependencies" (crateConfig.buildDependencies or {})) 1568 | ]; 1569 | 1570 | in [{inherit packageId; features = expandedFeatures;}] ++ resolvedDependencies; 1571 | 1572 | /* Returns the enabled dependencies given the enabled features. */ 1573 | filterEnabledDependencies = dependencies: features: 1574 | assert (builtins.isAttrs dependencies); 1575 | assert (builtins.isList features); 1576 | 1577 | lib.filterAttrs 1578 | (depName: dep: 1579 | builtins.isString dep 1580 | || dep.target or true 1581 | && (!(dep.optional or false) || builtins.any (doesFeatureEnableDependency depName) features)) 1582 | dependencies; 1583 | 1584 | /* Returns whether the given feature should enable the given dependency. */ 1585 | doesFeatureEnableDependency = depName: feature: 1586 | let prefix = "${depName}/"; 1587 | len = builtins.stringLength prefix; 1588 | startsWithPrefix = builtins.substring 0 len feature == prefix; 1589 | in feature == depName || startsWithPrefix; 1590 | 1591 | /* Returns the expanded features for the given inputFeatures by applying the rules in featureMap. 1592 | 1593 | featureMap is an attribute set which maps feature names to lists of further feature names to enable in case this 1594 | feature is selected. 1595 | */ 1596 | expandFeatures = featureMap: inputFeatures: 1597 | assert (builtins.isAttrs featureMap); 1598 | assert (builtins.isList inputFeatures); 1599 | 1600 | let expandFeature = feature: 1601 | assert (builtins.isString feature); 1602 | [feature] ++ (expandFeatures featureMap (featureMap."${feature}" or [])); 1603 | outFeatures = builtins.concatMap expandFeature inputFeatures; 1604 | in sortedUnique outFeatures; 1605 | 1606 | /* The package ID of the given dependency. */ 1607 | dependencyPackageId = dependency: if builtins.isString dependency then dependency else dependency.packageId; 1608 | 1609 | /* Returns the actual dependencies for the given dependency. */ 1610 | dependencyFeatures = features: dependencyName: dependency: 1611 | assert (builtins.isList features); 1612 | assert (builtins.isString dependencyName); 1613 | assert (builtins.isAttrs dependency || builtins.isString dependency); 1614 | 1615 | let defaultOrNil = if builtins.isString dependency || dependency.usesDefaultFeatures or true 1616 | then ["default"] 1617 | else []; 1618 | explicitFeatures = if builtins.isString dependency then [] else dependency.features or []; 1619 | additionalDependencyFeatures = 1620 | 1621 | let dependencyPrefix = dependencyName+"/"; 1622 | dependencyFeatures = 1623 | builtins.filter (f: lib.hasPrefix dependencyPrefix f) features; 1624 | in builtins.map (lib.removePrefix dependencyPrefix) dependencyFeatures; 1625 | in 1626 | defaultOrNil ++ explicitFeatures ++ additionalDependencyFeatures; 1627 | 1628 | /* Sorts and removes duplicates from a list of strings. */ 1629 | sortedUnique = features: 1630 | assert (builtins.isList features); 1631 | assert (builtins.all builtins.isString features); 1632 | 1633 | let outFeaturesSet = lib.foldl (set: feature: set // {"${feature}" = 1;} ) {} features; 1634 | outFeaturesUnique = builtins.attrNames outFeaturesSet; 1635 | in builtins.sort (a: b: a < b) outFeaturesUnique; 1636 | 1637 | # 1638 | # crate2nix/default.nix (excerpt end) 1639 | # 1640 | 1641 | } 1642 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["jD91mZM2 "] 3 | description = "powerline-shell rewritten in Rust. Inspired by powerline-go." 4 | edition = "2018" 5 | license-file = "LICENSE" 6 | name = "powerline-rs" 7 | readme = "README.org" 8 | repository = "https://github.com/jD91mZM2/powerline-rs" 9 | version = "0.2.1" 10 | 11 | [build-dependencies] 12 | clap = "2.33.0" 13 | 14 | [dependencies] 15 | clap = "2.33.0" 16 | dirs = "2.0.2" 17 | 18 | [dependencies.chrono] 19 | optional = true 20 | version = "0.4.9" 21 | 22 | [dependencies.flame] 23 | optional = true 24 | version = "0.2.2" 25 | 26 | [dependencies.git2] 27 | optional = true 28 | default-features = false 29 | version = "0.10.1" 30 | 31 | [dependencies.users] 32 | optional = true 33 | version = "0.9.1" 34 | 35 | [features] 36 | default = ["chrono", "git2", "users"] 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2019 jD91mZM2 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | * powerline-rs 2 | =powerline-rs= is a rewrite of [[https://github.com/b-ryan/powerline-shell][powerline-shell]], inspired by 3 | [[https://github.com/justjanne/powerline-go][powerline-go]]. 4 | 5 | *Note:* powerline-rs is in /somewhat/ of a maintenance mode. I'll try 6 | to make time to fix bugs and add new features, but the code is messy 7 | and I will not be fixing it any time soon unfortunately. It /could/ be 8 | reworked to be more generic and maybe read a config file for the 9 | prompt, since it's still going to be very fast thanks to rust. But I'm 10 | not going to implement that. Not now, at least. 11 | 12 | /That said,/ I still use this for my own prompt and will probably 13 | never stop, so don't worry it's definitely not a dead project. 14 | 15 | ** Why? 16 | Speed! I haven't done any extensive benchmarks, but it appears like 17 | even the debug version of =powerline-rs= is about 20 milliseconds 18 | faster than =powerline-go=. The Rust language is perfect for fast 19 | applications, since copying large structures isn't implicit. 20 | 21 | ** How to install 22 | I strongly recommend installing powerline-rs using the [[https://nixos.org/nix/][Nix package 23 | manager]], which will get you all the required native dependencies by 24 | default. 25 | 26 | #+BEGIN_SRC sh 27 | nix-env -iA powerline-rs 28 | #+END_SRC 29 | 30 | If you'd prefer the absolutely latest git version, you can use this 31 | instead: 32 | 33 | #+BEGIN_SRC sh 34 | nix-env -if https://gitlab.com/jD91mZM2/powerline-rs/-/archive/master.tar.gz 35 | #+END_SRC 36 | 37 | Then add the following code to your shell: 38 | - [[#bash][Bash]] 39 | - [[#fish][Fish]] 40 | - [[#ion][Ion]] 41 | - [[#zsh][Zsh]] 42 | 43 | *** Other installation options 44 | You can also install powerline-rs from an [[https://aur.archlinux.org/packages/powerline-rs/][unofficial AUR package]]. 45 | 46 | Using other installation options you'll unfortunately have to fetch 47 | all native dependencies yourself. I've tried to guess which 48 | dependencies most users will need to install to build this, feel free 49 | to update the following matrix if it proves outdated. 50 | 51 | | Configuration | Native dependencies | Description | 52 | |-----------------------+---------------------+---------------------------------------------------| 53 | | Default | All of the below | | 54 | | --no-default-features | None of the below | | 55 | | --features chrono | None | Add time support for `--shell bare` | 56 | | --features flame | None | Adds some performance benchmarks. Don't use this. | 57 | | --features git2 | libgit2, libzip | Add git support | 58 | | --features users | None | Add username support for `--shell bare` | 59 | 60 | You'll also need Rust, obviously. After that you can install 61 | powerline-rs via cargo. 62 | 63 | #+BEGIN_SRC sh 64 | cargo install powerline-rs 65 | #+END_SRC 66 | 67 | ** What's new? 68 | Well, the default modules have changed to not include the username and 69 | hostname. I feel like most people already know theirs. But you can 70 | always enable it, of course! 71 | ** What's optimized? 72 | - Generally just using Rust. 73 | - Using =libgit2= over calling and parsing =git= output (Thanks [[https://github.com/tbodt][tbodt]] 74 | for suggesting it!) 75 | - =libgit2= can be disabled at compile time if you don't plan on using 76 | git functionality. 77 | - Themes are using a simple small =key=value= scripts. No JSON 78 | overhead or similar. 79 | - The output of =powerline-rs= is slightly smaller than the 2 80 | alternatives I mentioned. To be honest, I have no idea why. 81 | ** What's removed? 82 | Most of the service-specific modules are deleted. I am very lazy. 83 | Pull requests are welcome, though. 84 | 85 | Also, the =jobs= module won't work with =--shell bare=. 86 | * Add it to your shell 87 | ** Bash 88 | :PROPERTIES: 89 | :CUSTOM_ID: bash 90 | :END: 91 | 92 | #+BEGIN_SRC sh 93 | prompt() { 94 | PS1="$(powerline-rs --shell bash $?)" 95 | } 96 | PROMPT_COMMAND=prompt 97 | #+END_SRC 98 | ** Zsh 99 | :PROPERTIES: 100 | :CUSTOM_ID: zsh 101 | :END: 102 | 103 | #+BEGIN_SRC sh 104 | prompt() { 105 | PS1="$(powerline-rs --shell zsh $?)" 106 | } 107 | precmd_functions+=(prompt) 108 | #+END_SRC 109 | ** Fish 110 | :PROPERTIES: 111 | :CUSTOM_ID: fish 112 | :END: 113 | 114 | #+BEGIN_SRC sh 115 | function fish_prompt 116 | powerline-rs --shell bare $status 117 | end 118 | #+END_SRC 119 | ** Ion 120 | :PROPERTIES: 121 | :CUSTOM_ID: ion 122 | :END: 123 | 124 | We can't display the success status because ion now forbids the use 125 | =$?= from functions as a bi-product of the new [[https://gitlab.redox-os.org/redox-os/ion/merge_requests/807][namespacing 126 | system]]. This will of course eventually be resolved. 127 | 128 | #+BEGIN_SRC sh 129 | fn PROMPT 130 | powerline-rs --shell bare 131 | end 132 | #+END_SRC 133 | 134 | ** Themes 135 | User contributed themes are found in contrib/ 136 | You can define usage of a theme with argument --theme ~/.dotfiles/powerline-rs/solarized.theme 137 | If no theme is defined the default theme will be used. 138 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate clap; 3 | 4 | mod module { include!("src/module.rs"); } 5 | mod cli { include!("src/cli.rs"); } 6 | 7 | use clap::Shell; 8 | use std::{fs, env}; 9 | 10 | fn main() { 11 | let dir = env::var("COMPLETION_OUT").or_else(|_| env::var("OUT_DIR")).expect("cargo didn't set $OUT_DIR"); 12 | fs::create_dir_all(&dir).expect("failed to create directories"); 13 | 14 | let mut app = cli::build_cli(); 15 | app.gen_completions("powerline-rs", Shell::Bash, &dir); 16 | app.gen_completions("powerline-rs", Shell::Fish, &dir); 17 | } 18 | -------------------------------------------------------------------------------- /contrib/gruvbox.theme: -------------------------------------------------------------------------------- 1 | # Gruvbox theme 2 | # ported from powerline-shell grubox theme 3 | # https://github.com/b-ryan/powerline-shell/blob/master/powerline_shell/themes/gruvbox.py 4 | 5 | separator_fg = 245 6 | 7 | home_bg = 66 8 | home_fg = 250 9 | path_bg = 241 10 | path_fg = 248 11 | cwd_fg = 250 12 | 13 | username_bg = 239 14 | username_fg = 175 15 | username_root_bg = 88 16 | hostname_bg = 237 17 | hostname_fg = 175 18 | 19 | jobs_bg = 72 20 | jobs_fg = 237 21 | 22 | time_bg = 243 23 | time_fg = 250 24 | 25 | ssh_bg = 96 26 | ssh_fg = 229 27 | 28 | ro_bg = 167 29 | ro_fg = 229 30 | 31 | git_clean_bg = 100 32 | git_clean_fg = 237 33 | git_dirty_bg = 130 34 | git_dirty_fg = 229 35 | git_ahead_bg = 239 36 | git_ahead_fg = 248 37 | git_behind_bg = 239 38 | git_behind_fg = 248 39 | git_staged_bg = 106 40 | git_staged_fg = 229 41 | git_notstaged_bg = 166 42 | git_notstaged_fg = 229 43 | git_untracked_bg = 88 44 | git_untracked_fg = 229 45 | git_conflicted_bg = 124 46 | git_conflicted_fg = 229 47 | 48 | cmd_passed_bg = 237 49 | cmd_passed_fg = 246 50 | cmd_failed_bg = 124 51 | cmd_failed_fg = 229 52 | -------------------------------------------------------------------------------- /contrib/solarized_dark.theme: -------------------------------------------------------------------------------- 1 | # A port of the solarized_dark from powerline-shell 2 | # https://github.com/b-ryan/powerline-shell/blob/master/powerline_shell/themes/solarized_dark.py 3 | 4 | separator_fg = 14 5 | 6 | home_bg = 15 7 | home_fg = 10 8 | path_bg = 10 9 | path_fg = 7 10 | cwd_fg = 15 11 | 12 | username_bg = 4 13 | username_fg = 15 14 | username_root_bg = 1 15 | hostname_bg = 10 16 | hostname_fg = 15 17 | 18 | jobs_bg = 4 19 | jobs_fg = 8 20 | 21 | time_bg = 10 22 | time_fg = 15 23 | 24 | ssh_bg = 0 25 | ssh_fg = 3 26 | 27 | ro_bg = 1 28 | ro_fg = 7 29 | 30 | git_clean_bg = 0 31 | git_clean_fg = 14 32 | git_dirty_bg = 0 33 | git_dirty_fg = 3 34 | git_ahead_bg = 240 35 | git_ahead_fg = 250 36 | git_behind_bg = 240 37 | git_behind_fg = 250 38 | git_conflicted_bg = 9 39 | git_conflicted_fg = 15 40 | git_notstaged_bg = 130 41 | git_notstaged_fg = 15 42 | git_staged_bg = 22 43 | git_staged_fg = 15 44 | git_untracked_bg = 42 45 | git_untracked_fg = 15 46 | 47 | git_ahead_char = ⬆ 48 | git_behind_char = ⬇ 49 | git_staged_char = ✔ 50 | git_notstaged_char = ✎ 51 | git_untracked_char = + 52 | git_conflicted_char = * 53 | 54 | cmd_passed_bg = 2 55 | cmd_passed_fg = 15 56 | cmd_failed_bg = 1 57 | cmd_failed_fg = 15 58 | -------------------------------------------------------------------------------- /crate-hashes.json: -------------------------------------------------------------------------------- 1 | { 2 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)": "08fk0p2xvkqpmz3zlrwnf6l8sj2vngw464rvzspzp31sbgxbwm4v", 3 | "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)": "00dfn9lbr4pc524imc25v3rbmswiqk3jldsgmx4rdngcpxb8ssjf", 4 | "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)": "0g11if4ihxifdiiwk6brnywkpgbvfbfwxgfqw5a407hprcq3s49f", 5 | "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)": "0a1ii8h9fvvrq05bz7j135zjjz1sjz6n2invn2ngxqri0jxgmip2", 6 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)": "01iq4rs9kanj88pbwjxzqp5k4bgdsvz3y398nljz441rfws11mi4", 7 | "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)": "0xzgw3vldpfcfhsxs17jx3l6vacfxm93g3l363k5vk0nc7avgzar", 8 | "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)": "1jrb7450v9kyqrjc97vzckbpwj9jakvc1jkq95i46g6mn9kvqkgr", 9 | "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)": "1zz3jq619hahla1f70ra38818b5n8cp4iilij81i90jq6z7hlfhg", 10 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)": "0b77awhpn7yaqjjibm69ginfn996azx5vkzfjj39g3wbsqs7mkxg", 11 | "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)": "14974amxa9lgn8syjp1am4yj4vhmcc27k21bvyz4fsawv3hfv204", 12 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)": "099fxwc79ncpcl8dgg9hql8gznz11a3sjs7pai0mg6w8r05khvdx", 13 | "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)": "1r5cp143kvbyxcwna60jxlrjq8sc78sxj912hh01g1g6kkhm7mb6", 14 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)": "0x52qzpbyl2f2jqs7kkqzgfki2cpq99gpfjjigdp8pwwfqk01007", 15 | "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)": "0nw75j1q0idg5a57k68l87422nq8naq818cdxh390byws63a8yfj", 16 | "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)": "054n9ngh6pkknpmd4acgdsp40iw6f5jzq8a4h2b76gnbvk6p5xjh", 17 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)": "1z9lby5sr6vslfd14d6igk03s7awf91mxpsfmsp3prxbxlk0x7h5", 18 | "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)": "0k3b5yavx7si8cy030py6bhgmg24sghzs8chbs4d4r13wjp5c5ih", 19 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)": "01gxccmrjkkcavdh8fc01kj3b5fmk10f0lkx66jmnv69kcssry72", 20 | "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)": "0zk0kdnl2hd3qk76yq6yk7hc7s73gpnnzi1p208ygrh270y96fpx", 21 | "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)": "1hb7h6g5xyhc26v8d8fksxfw1gv6kl427jzp9vhl7y8v6992d80d", 22 | "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)": "09qsxzrxzqz7h76sd5klfk6nq407way77j898519ll7pr5yk3j65", 23 | "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)": "00ps2s591hh2sicdv3ix6gv3qf39n5qf67q0mjff90ha8hvsykpj", 24 | "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)": "07apwv9dj716yjlcj29p94vkqn5zmfh7hlrqvrjx3wzshphc95h9", 25 | "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)": "0n3cyf8vm82hbbj6xzgaszjn852i0jl9qxibl7im7mvn7s9yrvb6", 26 | "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)": "18a4n241m34vb1myyh5ysg3608qaz7x72p2cviylk4gp72vk4alq", 27 | "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)": "1mm05aq43qc5n492njnac5xn4rhiraii25xc0hwppr471jzijh8d", 28 | "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)": "0qazd61l3zgnchzrr9gkvvdzdz1d6g8xrc2skac5qa0ykd1yblyx", 29 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)": "13h6sdghdcy7vcqsm2gasfw3qg7ssa0fl3sw7lq6pdkbk52wbyfr", 30 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)": "0nx1n3xvwj2ikw1d6v17154jx2sb9sgrv6fwbnq79c614a3mhmad", 31 | "libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)": "08cc5k5w9h1gp411lgnz3q7n3bhl4vq6a54bbnalwqqx9i4scb6x", 32 | "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)": "195jzg8mgjbvmkbpx1rzkzrqm0g2fdivk79v44c9lzl64r3f9fym", 33 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)": "0wvzzzcn89dai172rrqcyz06pzldyyy0lf0w71csmn206rdpnb15", 34 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)": "03hl636fg6xggy0a26200xs74amk3k9n0908rga2szn68agyz3cv", 35 | "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)": "0b4adir378n2irr76z8grc9jxif8vlyy01rid8j4r716y9y4dg9r", 36 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)": "1y45nh9xlp2dra9svb1wfsy65fysm3k1w4m8jynywccq645yixid", 37 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)": "1mnlmy35n734n9xlq0qkfbgzz33x09a1s4rfj30p1976p09b862v", 38 | "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)": "1zi5s2cbnqqb0k0kdd6gqn2x97f9bssv44430h6w28awwzppyh8i", 39 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)": "0i838f2nr81585ckmfymf8l1x1vdmx6n8xqvli0lgcy60yl2axy3", 40 | "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)": "1a2gg5a9l74brz1vzkkzfl8aihd7b4rk3vhbmiahkmpzavywza5j", 41 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)": "1l56ss9ip8cg6764cpi9y8dv7nsyqf2i4hb7sn29zx61n03jr81z", 42 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)": "0r7030w7dymarn92gjgm02hsm04fwsfs6f1l20wdqiyrm9z8rs5q", 43 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)": "0q0ssgpj9x5a6fda83nhmfydy7a6c0wvxm0jhncsmjx8qp8gw91m", 44 | "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)": "18zpzwn4bl7lp9f36iacy8mvdnfrhfmzsl35gmln98dcindff2ly", 45 | "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)": "0ywwspizgs9g8vzn6m5ix9yg36n15119d6n792h7mk4r5vs0ww4j", 46 | "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)": "15hrcasn0v876wpkwab1dwbk9kvqwrb3iv4y4dibb6yxnfvzwajk", 47 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)": "0jcp8nd947zcy938bz09pzlmi3vyxfdzg92pjxdvvk0699vwcc26", 48 | "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)": "0kqc1vjmkcvgkxjpqva3nyqd9dixivsh4qswxclyqf7ql8a2g17s", 49 | "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)": "049dqwn63i6xix55cnh8n4iqm2d3yzpisfsc2568vfmaaa4866d2", 50 | "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)": "0zmn448d0f898ahfkz7cir0fi0vk84dabjpw84mk6a1r6nf9vzmi", 51 | "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)": "01w7xd79q0bwn683gk4ryw50ad1zzxkny10f7gkbaaj1ax6f4q4h", 52 | "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)": "0d3jsdz22wgjyxdakqnvdgmwjdvkximz50d9zfk4qlalw635qcvy", 53 | "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)": "08qbk425r8c4q4rrpq1q9wkd3v3bji8nlfaxj8v4l7lkpjkh0xgs", 54 | "synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)": "19r76q37zdz4ja37s4gnq317liqnamawydgkz240ak9h4pzm95wc", 55 | "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)": "0s25qh49n7kjayrdj4q3v0jk0jc6vy88rdw0bvgfxqlscpqpxi7d", 56 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)": "1ny809kmdjwd4b478ipc33dz7q6nq7rxk766x8cnrg6zygcksmmx", 57 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)": "0lcd6jasrf8p9p0q20qyf10c6xhvw40m2c4rr105hbk6zy26nj1q", 58 | "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)": "1pb26i2xd5zz0icabyqahikpca0iwj2jd4145pczc4bb7p641dsz", 59 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)": "1mss965j7d8pv7z7zg6qfkcb7lyhxkxvbh8akzr4xxxx3vzazwsi", 60 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)": "1c85gb3p3qhbjvfyjb31m06la4f024jx319k10ig7n47dz2fk8v7", 61 | "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)": "0mvv28fvrrv3hc064gjgpqjvjn1j151qbi9i5bcilal6rkcd1brq", 62 | "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)": "0k5fc6hq7qmanfrvllij6qqmk9m9h8zmk17gwhcyz1dv11f6hy21", 63 | "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)": "1lwykbbscbdy4nhrfidgg3rk2xw9cvx5672sx1c97wm8y3vjpcd9", 64 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)": "1jj2nrg8h3l53d43rwkpkikq5a5x15ms4rf1rw92hp5lrqhi8mpi", 65 | "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)": "1lqknxy8x9mrsy0pna6xlwzypbhli73nbai9gmin5f4z1ghlng25", 66 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)": "084ialbgww1vxry341fmkg5crgpvab3w52ahx1wa54yqjgym0vxs", 67 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)": "05ihkij18r4gamjpxj4gra24514can762imjzlmak5wlzidplzrp", 68 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)": "0n1ylmlsb8yg1v583i4xy0qmqg42275flvbc51hdqjjfjcl9vlbj" 69 | } -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | (pkgs.callPackage ./Cargo.nix {}).workspaceMembers.powerline-rs.build 4 | -------------------------------------------------------------------------------- /default.theme: -------------------------------------------------------------------------------- 1 | # Default theme 2 | # Note: Missing values default to the default. That means this might as well be 3 | # an empty file. 4 | # Note 2: This file isn't used. In order to speed things up, the defaults are 5 | # hardcoded. 6 | # Note 3: Empty lines are ignored. So are lines starting with '#', (like these 7 | # ones). 8 | 9 | separator_fg = 244 10 | 11 | home_bg = 31 12 | home_fg = 15 13 | path_bg = 237 14 | path_fg = 250 15 | cwd_fg = 254 16 | 17 | username_bg = 240 18 | username_fg = 250 19 | username_root_bg = 124 20 | hostname_bg = 238 21 | hostname_fg = 250 22 | 23 | jobs_bg = 238 24 | jobs_fg = 39 25 | 26 | time_bg = 238 27 | time_fg = 250 28 | 29 | ssh_bg = 166 30 | ssh_fg = 254 31 | 32 | ssh_char =  33 | 34 | ro_bg = 124 35 | ro_fg = 254 36 | 37 | ro_char =  38 | 39 | git_clean_bg = 148 40 | git_clean_fg = 0 41 | git_dirty_bg = 161 42 | git_dirty_fg = 15 43 | git_ahead_bg = 240 44 | git_ahead_fg = 250 45 | git_behind_bg = 240 46 | git_behind_fg = 250 47 | git_conflicted_bg = 9 48 | git_conflicted_fg = 15 49 | git_notstaged_bg = 130 50 | git_notstaged_fg = 15 51 | git_staged_bg = 22 52 | git_staged_fg = 15 53 | git_untracked_bg = 52 54 | git_untracked_fg = 15 55 | 56 | git_ahead_char = ⬆ 57 | git_behind_char = ⬇ 58 | git_staged_char = ✔ 59 | git_notstaged_char = ✎ 60 | git_untracked_char = + 61 | git_conflicted_char = * 62 | 63 | cmd_passed_bg = 236 64 | cmd_passed_fg = 15 65 | cmd_failed_bg = 161 66 | cmd_failed_fg = 15 67 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | pkgs.mkShell { 4 | # Things to be put in $PATH 5 | nativeBuildInputs = with pkgs; [ pkgconfig ]; 6 | 7 | # Libraries to be installed 8 | buildInputs = with pkgs; [ openssl ]; 9 | } 10 | -------------------------------------------------------------------------------- /src/cli.rs: -------------------------------------------------------------------------------- 1 | use clap::{App, Arg}; 2 | 3 | pub const TIME_FORMAT_DEFAULT: &str = "%I:%M %p"; 4 | 5 | pub fn build_cli() -> App<'static, 'static> { 6 | App::new(crate_name!()) 7 | .about(crate_description!()) 8 | .author(crate_authors!()) 9 | .version(crate_version!()) 10 | .arg( 11 | Arg::with_name("cwd-max-depth") 12 | .long("cwd-max-depth") 13 | .help("Maximum number of directories to show in path") 14 | .takes_value(true) 15 | .value_name("int") 16 | .default_value("5") 17 | ) 18 | .arg( 19 | Arg::with_name("cwd-max-dir-size") 20 | .long("cwd-max-dir-size") 21 | .help("Maximum number of letters displayed for each directory in the path.\ 22 | Setting this to 0 means unlimited.") 23 | .takes_value(true) 24 | .value_name("int") 25 | .default_value("15") 26 | ) 27 | .arg( 28 | Arg::with_name("error") 29 | .help("Exit code of previously executed command") 30 | .default_value("0") 31 | ) 32 | .arg( 33 | Arg::with_name("time_format") 34 | .long("time_format") 35 | .help("strftime") 36 | .hidden(!cfg!(feature = "chrono")) 37 | .takes_value(true) 38 | .value_name("string") 39 | .default_value(TIME_FORMAT_DEFAULT) 40 | ) 41 | .arg( 42 | Arg::with_name("modules") 43 | .long("modules") 44 | .help("The list of modules to load, separated by ','") 45 | .takes_value(true) 46 | .value_name("string") 47 | .possible_values(crate::module::ALL) 48 | .value_delimiter(",") 49 | .default_value("ssh,cwd,perms,git,gitstage,nix-shell,root") 50 | ) 51 | .arg( 52 | Arg::with_name("newline") 53 | .long("newline") 54 | .help("Adds a newline after the prompt") 55 | ) 56 | .arg( 57 | Arg::with_name("shell") 58 | .long("shell") 59 | .help("Set this to your shell type") 60 | .takes_value(true) 61 | .value_name("string") 62 | .possible_values(&["bare", "bash", "zsh"]) 63 | .default_value("bash") 64 | ) 65 | .arg( 66 | Arg::with_name("theme") 67 | .long("theme") 68 | .help("Set this to the theme you want to use") 69 | .takes_value(true) 70 | .value_name("file") 71 | ) 72 | .arg( 73 | Arg::with_name("rtl") 74 | .long("rtl") 75 | .help("Print everything from right to left") 76 | ) 77 | } 78 | -------------------------------------------------------------------------------- /src/format.rs: -------------------------------------------------------------------------------- 1 | use crate::Shell; 2 | use std::fmt; 3 | 4 | pub struct Fg(pub Shell, pub u8); 5 | impl fmt::Display for Fg { 6 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 7 | if self.1 == 0 { 8 | Reset(self.0, true).fmt(f) 9 | } else { 10 | match self.0 { 11 | Shell::Bare => write!(f, "\x1b[38;5;{}m", self.1), 12 | Shell::Bash => write!(f, "\\[\\e[38;5;{}m\\]", self.1), 13 | Shell::Zsh => write!(f, "%{{\x1b[38;5;{}m%}}", self.1) 14 | } 15 | } 16 | } 17 | } 18 | 19 | pub struct Bg(pub Shell, pub u8); 20 | impl fmt::Display for Bg { 21 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 22 | if self.1 == 0 { 23 | Reset(self.0, false).fmt(f) 24 | } else { 25 | match self.0 { 26 | Shell::Bare => write!(f, "\x1b[48;5;{}m", self.1), 27 | Shell::Bash => write!(f, "\\[\\e[48;5;{}m\\]", self.1), 28 | Shell::Zsh => write!(f, "%{{\x1b[48;5;{}m%}}", self.1) 29 | } 30 | } 31 | } 32 | } 33 | 34 | pub struct Reset(pub Shell, pub bool); 35 | impl fmt::Display for Reset { 36 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 37 | let reset = if self.1 { "3" } else { "4" }; 38 | match self.0 { 39 | Shell::Bare => write!(f, "\x1b[{}9m", reset), 40 | Shell::Bash => write!(f, "\\[\\e[{}9m\\]", reset), 41 | Shell::Zsh => write!(f, "%{{\x1b[{}9m%}}", reset) 42 | } 43 | } 44 | } 45 | 46 | pub fn root(shell: Shell) -> &'static str { 47 | match shell { 48 | Shell::Bare => "$", 49 | Shell::Bash => "\\$", 50 | Shell::Zsh => "%#" 51 | } 52 | } 53 | pub fn escape(shell: Shell, string: &mut String) { 54 | if shell == Shell::Bare { 55 | return; 56 | } 57 | let mut output = String::with_capacity(string.len()); 58 | for c in string.chars() { 59 | match shell { 60 | Shell::Bash => match c { 61 | '\\' => output.push_str("\\\\"), 62 | '$' => output.push_str("\\$"), 63 | '"' => output.push_str("\\\""), 64 | c => output.push(c) 65 | }, 66 | Shell::Zsh => match c { 67 | '%' => output.push_str("%%"), 68 | ')' => output.push_str("%)"), 69 | c => output.push(c) 70 | }, 71 | Shell::Bare => unreachable!() 72 | } 73 | } 74 | *string = output; 75 | } 76 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate clap; 3 | 4 | mod cli; 5 | mod format; 6 | mod module; 7 | mod segments; 8 | mod theme; 9 | 10 | use crate::module::Module; 11 | use crate::segments::Segment; 12 | use crate::theme::Theme; 13 | 14 | #[derive(Clone, Copy, Eq, PartialEq)] 15 | pub enum Shell { 16 | Bare, 17 | Bash, 18 | Zsh 19 | } 20 | 21 | pub struct Powerline { 22 | segments: Vec, 23 | theme: Theme, 24 | shell: Shell, 25 | 26 | #[cfg(feature = "git2")] 27 | git: Option, 28 | #[cfg(feature = "git2")] 29 | git_statuses: Option> 30 | } 31 | 32 | fn main() { 33 | #[cfg(feature = "flame")] 34 | flame::start("clap-rs"); 35 | 36 | let matches = cli::build_cli().get_matches(); 37 | 38 | #[cfg(feature = "flame")] 39 | flame::end("clap-rs"); 40 | 41 | #[cfg(feature = "flame")] 42 | flame::start("parse arguments"); 43 | 44 | let cwd_max_depth = value_t_or_exit!(matches, "cwd-max-depth", u8); 45 | let cwd_max_dir_size = value_t_or_exit!(matches, "cwd-max-dir-size", u8); 46 | let error = value_t_or_exit!(matches, "error", u8); 47 | 48 | #[cfg(feature = "flame")] 49 | flame::start("parse theme"); 50 | 51 | let theme = if let Some(file) = matches.value_of("theme") { 52 | if let Ok(theme) = theme::load(file) { 53 | theme 54 | } else { 55 | eprintln!("Invalid theme."); 56 | theme::DEFAULT 57 | } 58 | } else { theme::DEFAULT }; 59 | 60 | #[cfg(feature = "flame")] 61 | flame::end("parse theme"); 62 | 63 | #[cfg(feature = "flame")] 64 | flame::start("parse modules"); 65 | 66 | let modules: Vec<_> = matches 67 | .values_of("modules") 68 | .unwrap() 69 | .map(|module| module.parse().unwrap()) 70 | .collect(); 71 | 72 | let time_format = matches.value_of("time_format").unwrap(); 73 | 74 | #[cfg(feature = "flame")] 75 | flame::end("parse modules"); 76 | 77 | #[cfg(feature = "flame")] 78 | flame::end("parse arguments"); 79 | 80 | #[cfg(feature = "flame")] 81 | flame::start("main"); 82 | 83 | let mut p = Powerline { 84 | segments: Vec::with_capacity(16), // just a guess 85 | theme, 86 | shell: match matches.value_of("shell").unwrap() { 87 | "bare" => Shell::Bare, 88 | "bash" => Shell::Bash, 89 | "zsh" => Shell::Zsh, 90 | _ => unreachable!() 91 | }, 92 | 93 | #[cfg(feature = "git2")] 94 | git: None, 95 | #[cfg(feature = "git2")] 96 | git_statuses: None 97 | }; 98 | 99 | for module in modules { 100 | match module { 101 | Module::Cwd => segments::segment_cwd(&mut p, cwd_max_depth, cwd_max_dir_size), 102 | Module::Git => { #[cfg(feature = "git2")] segments::segment_git(&mut p) }, 103 | Module::GitStage => { #[cfg(feature = "git2")] segments::segment_gitstage(&mut p) }, 104 | Module::Host => segments::segment_host(&mut p), 105 | Module::Jobs => segments::segment_jobs(&mut p), 106 | Module::NixShell => segments::segment_nix(&mut p), 107 | Module::Perms => segments::segment_perms(&mut p), 108 | Module::Ps => segments::segment_ps(&mut p), 109 | Module::Root => segments::segment_root(&mut p, error), 110 | Module::Ssh => segments::segment_ssh(&mut p), 111 | Module::Time => segments::segment_time(&mut p, &time_format), 112 | Module::User => segments::segment_user(&mut p), 113 | Module::LineBreak => segments::segment_linebreak(&mut p), 114 | Module::VirtualEnv => segments::segment_virtualenv(&mut p), 115 | } 116 | } 117 | 118 | #[cfg(feature = "flame")] 119 | flame::end("main"); 120 | #[cfg(feature = "flame")] 121 | flame::start("print"); 122 | 123 | if matches.is_present("rtl") { 124 | let n = p.segments.len(); 125 | for i in 1..n+1 { 126 | p.segments[n-i].escape(p.shell); 127 | p.segments[n-i].print_rtl(p.segments.get(n-i+1), p.shell, &p.theme); 128 | } 129 | } else { 130 | for i in 0..p.segments.len() { 131 | p.segments[i].escape(p.shell); 132 | p.segments[i].print(p.segments.get(i+1), p.shell, &p.theme); 133 | } 134 | } 135 | 136 | if matches.is_present("newline") { 137 | println!(); 138 | } else if !matches.is_present("rtl") { 139 | print!(" "); 140 | } 141 | 142 | #[cfg(feature = "flame")] 143 | flame::end("print"); 144 | 145 | #[cfg(feature = "flame")] 146 | { 147 | use std::fs::File; 148 | flame::dump_html(&mut File::create("profile.html").unwrap()).unwrap(); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/module.rs: -------------------------------------------------------------------------------- 1 | use std::str::FromStr; 2 | 3 | pub const ALL: &[&str] = &[ 4 | "cwd", 5 | "git", 6 | "gitstage", 7 | "host", 8 | "jobs", 9 | "nix-shell", 10 | "perms", 11 | "ps", 12 | "root", 13 | "ssh", 14 | "time", 15 | "user", 16 | "virtualenv", 17 | "linebreak", 18 | ]; 19 | 20 | #[derive(PartialEq, Eq)] 21 | pub enum Module { 22 | Cwd, 23 | Git, 24 | GitStage, 25 | Host, 26 | Jobs, 27 | NixShell, 28 | Perms, 29 | Ps, 30 | Root, 31 | Ssh, 32 | Time, 33 | User, 34 | VirtualEnv, 35 | LineBreak, 36 | } 37 | 38 | impl FromStr for Module { 39 | type Err = (); 40 | fn from_str(s: &str) -> Result { 41 | match s { 42 | "cwd" => Ok(Module::Cwd), 43 | "git" => Ok(Module::Git), 44 | "gitstage" => Ok(Module::GitStage), 45 | "host" => Ok(Module::Host), 46 | "jobs" => Ok(Module::Jobs), 47 | "nix-shell" => Ok(Module::NixShell), 48 | "perms" => Ok(Module::Perms), 49 | "ps" => Ok(Module::Ps), 50 | "root" => Ok(Module::Root), 51 | "ssh" => Ok(Module::Ssh), 52 | "time" => Ok(Module::Time), 53 | "user" => Ok(Module::User), 54 | "virtualenv" => Ok(Module::VirtualEnv), 55 | "linebreak" => Ok(Module::LineBreak), 56 | _ => Err(()) 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/segments/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod segment_cwd; 2 | pub mod segment_host; 3 | pub mod segment_jobs; 4 | pub mod segment_nix; 5 | pub mod segment_perms; 6 | pub mod segment_ps; 7 | pub mod segment_root; 8 | pub mod segment_ssh; 9 | pub mod segment_time; 10 | pub mod segment_user; 11 | pub mod segment_virtualenv; 12 | pub mod segment_linebreak; 13 | 14 | pub use self::segment_cwd::*; 15 | pub use self::segment_host::*; 16 | pub use self::segment_jobs::*; 17 | pub use self::segment_nix::*; 18 | pub use self::segment_perms::*; 19 | pub use self::segment_ps::*; 20 | pub use self::segment_root::*; 21 | pub use self::segment_ssh::*; 22 | pub use self::segment_time::*; 23 | pub use self::segment_user::*; 24 | pub use self::segment_virtualenv::*; 25 | pub use self::segment_linebreak::*; 26 | 27 | #[cfg(feature = "git2")] pub mod segment_git; 28 | #[cfg(feature = "git2")] pub use self::segment_git::*; 29 | 30 | 31 | use crate::Shell; 32 | use crate::format::*; 33 | use std::borrow::Cow; 34 | use crate::theme::Theme; 35 | 36 | pub struct Segment { 37 | bg: u8, 38 | fg: u8, 39 | 40 | before: &'static str, 41 | after: &'static str, 42 | conditional: bool, 43 | no_space_after: bool, 44 | 45 | escaped: bool, 46 | text: Cow<'static, str> 47 | } 48 | impl Segment { 49 | pub fn new(bg: u8, fg: u8, text: S) -> Self 50 | where S: Into> 51 | { 52 | Segment { 53 | bg, 54 | fg, 55 | 56 | before: "", 57 | after: "", 58 | conditional: false, 59 | no_space_after: false, 60 | 61 | escaped: false, 62 | text: text.into() 63 | } 64 | } 65 | pub fn dont_escape(mut self) -> Self { 66 | self.escaped = true; 67 | self 68 | } 69 | pub fn with_before(mut self, before: &'static str) -> Self { 70 | self.before = before; 71 | self 72 | } 73 | pub fn with_after(mut self, after: &'static str) -> Self { 74 | self.after = after; 75 | self 76 | } 77 | pub fn into_conditional(mut self) -> Self { 78 | self.conditional = true; 79 | self 80 | } 81 | pub fn is_conditional(&self) -> bool { 82 | self.conditional 83 | } 84 | pub fn with_no_space_after(mut self) -> Self { 85 | self.no_space_after = true; 86 | self 87 | } 88 | pub fn escape(&mut self, shell: Shell) { 89 | if self.escaped { 90 | return; 91 | } 92 | escape(shell, self.text.to_mut()); 93 | self.escaped = true; 94 | } 95 | pub fn print(&self, next: Option<&Segment>, shell: Shell, theme: &Theme) { 96 | print!("{}{}{} {}", self.before, Fg(shell, self.fg), Bg(shell, self.bg), self.text); 97 | 98 | if !self.no_space_after { 99 | print!(" ") 100 | } 101 | match next { 102 | Some(next) if next.is_conditional() => {}, 103 | Some(next) if next.bg == self.bg => print!("{}", Fg(shell, theme.separator_fg)), 104 | Some(next) if self.bg == 0 => print!("{}{}", Fg(shell, next.bg), Bg(shell, next.bg)), 105 | Some(next) => print!("{}{}", Fg(shell, self.bg), Bg(shell, next.bg)), 106 | // Last tile resets colors 107 | None => print!("{}{}{}",Fg(shell, self.bg), Reset(shell, false), Reset(shell, true)) 108 | } 109 | print!("{}", self.after); 110 | } 111 | pub fn print_rtl(&self, next: Option<&Segment>, shell: Shell, theme: &Theme) { 112 | // Here, next is going leftwards - see how this func is called in main.rs . 113 | print!("{}", self.after); 114 | match next { 115 | Some(next) if next.is_conditional() => {}, 116 | Some(next) if next.bg == self.bg => 117 | print!("{}{}", Fg(shell, theme.separator_fg), Bg(shell, self.bg)), 118 | Some(next) => print!("{}{}", Fg(shell, self.bg), Bg(shell, next.bg)), 119 | None => print!("{}", Fg(shell, self.bg)) 120 | } 121 | print!("{}{} {}", Fg(shell, self.fg), Bg(shell, self.bg), self.text); 122 | 123 | if !self.no_space_after { 124 | print!(" ") 125 | } 126 | print!("{}{}{}", Reset(shell, false), Reset(shell, true), self.before); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/segments/segment_cwd.rs: -------------------------------------------------------------------------------- 1 | use crate::{Powerline, Segment}; 2 | use std::{ 3 | borrow::Cow, 4 | env, 5 | ffi::OsStr, 6 | path::PathBuf 7 | }; 8 | 9 | pub fn segment_cwd(p: &mut Powerline, cwd_max_depth: u8, cwd_max_dir_size: u8) { 10 | let mut path = env::current_dir().unwrap_or_else(|_| PathBuf::from("error")); 11 | if let Some(home) = dirs::home_dir() { 12 | let mut new_path = None; 13 | if let Ok(new) = path.strip_prefix(&home) { 14 | p.segments.push(Segment::new(p.theme.home_bg, p.theme.home_fg, "~")); 15 | // TODO: NLL: path = new.to_path_buf(); 16 | new_path = Some(new.to_path_buf()); 17 | } 18 | if let Some(new) = new_path { 19 | path = new; 20 | } 21 | } 22 | 23 | let length = path.iter().count(); 24 | let mut dirs = path.iter(); 25 | 26 | let cwd_max_depth = cwd_max_depth as usize; 27 | 28 | if cwd_max_depth != 1 { 29 | if let Some(dir) = dirs.next() { 30 | // Either there's no cwd_max_depth, or it's bigger than 1 31 | segment(p, dir, length == 1, cwd_max_dir_size); 32 | 33 | // It would be sane here to subtract 1 from both length and 34 | // cwd_max_depth, to make it clear that we already tried one and 35 | // what the below code is doing. HOWEVER, currently that results in 36 | // the exact same outcome. 37 | } 38 | } 39 | if cwd_max_depth > 0 && length > cwd_max_depth { 40 | p.segments.push(Segment::new(p.theme.path_bg, p.theme.path_fg, Cow::from("…"))); 41 | 42 | for _ in 0..length - cwd_max_depth { 43 | dirs.next().unwrap(); 44 | } 45 | } 46 | 47 | let mut next = dirs.next(); 48 | while let Some(cursor) = next { 49 | next = dirs.next(); 50 | 51 | segment(p, cursor, next.is_none(), cwd_max_dir_size); 52 | } 53 | } 54 | pub fn segment(p: &mut Powerline, name: &OsStr, last: bool, cwd_max_dir_size: u8) { 55 | let mut name = name.to_string_lossy().into_owned(); 56 | 57 | let cwd_max_dir_size = cwd_max_dir_size as usize; 58 | if cwd_max_dir_size > 0 && name.chars().count() > cwd_max_dir_size { 59 | let mut start = 0; 60 | for c in name.chars().take(cwd_max_dir_size) { 61 | start += c.len_utf8(); 62 | } 63 | name.drain(start..); 64 | name.push('…'); 65 | } 66 | 67 | let fg = if last { p.theme.cwd_fg } else { p.theme.path_fg }; 68 | p.segments.push(Segment::new(p.theme.path_bg, fg, name)); 69 | } 70 | -------------------------------------------------------------------------------- /src/segments/segment_git.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "flame")] use flame; 2 | use crate::{Powerline, Segment}; 3 | use git2::{BranchType, ObjectType, Repository, Status, StatusOptions, StatusShow}; 4 | 5 | fn discover_if_none(git: &mut Option) -> bool { 6 | #[cfg(feature = "flame")] 7 | let _guard = flame::start_guard("git discover"); 8 | 9 | if git.is_none() { 10 | *git = Repository::discover(".").ok(); 11 | git.is_some() 12 | } else { true } 13 | } 14 | fn statuses_if_none(git: &Repository, statuses: &mut Option>) -> bool { 15 | #[cfg(feature = "flame")] 16 | let _guard = flame::start_guard("git status"); 17 | 18 | if statuses.is_none() { 19 | *statuses = git.statuses(Some( 20 | StatusOptions::new() 21 | .show(StatusShow::IndexAndWorkdir) 22 | .include_untracked(true) 23 | .renames_from_rewrites(true) 24 | .renames_head_to_index(true) 25 | )) 26 | .ok() 27 | .map(|statuses| 28 | statuses.iter() 29 | .map(|entry| entry.status()) 30 | .collect()); 31 | statuses.is_some() 32 | } else { true } 33 | } 34 | 35 | pub fn segment_git(p: &mut Powerline) { 36 | #[cfg(feature = "flame")] 37 | let _guard = flame::start_guard("segment git"); 38 | 39 | if !discover_if_none(&mut p.git) { 40 | return; 41 | } 42 | let git = p.git.as_ref().unwrap(); 43 | 44 | #[cfg(feature = "flame")] 45 | flame::start("iter branches"); 46 | 47 | let branches = git.branches(Some(BranchType::Local)); 48 | if branches.is_err() { 49 | return; 50 | } 51 | 52 | let mut branch_name = None; 53 | let mut local = None; 54 | let mut upstream = None; 55 | 56 | for branch in branches.unwrap() { 57 | if let Ok((branch, _)) = branch { 58 | if branch.is_head() { 59 | local = branch.get().target(); 60 | upstream = branch.upstream().ok().and_then(|b| b.get().target()); 61 | 62 | if let Ok(name) = branch.name() { 63 | if let Some(name) = name { 64 | branch_name = Some(name.to_string()); 65 | break; 66 | } 67 | } 68 | } 69 | } 70 | } 71 | 72 | #[cfg(feature = "flame")] 73 | flame::end("iter branches"); 74 | 75 | if branch_name.is_none() { 76 | #[cfg(feature = "flame")] 77 | let _guard = flame::start_guard("search head"); 78 | 79 | // Could be a detached head 80 | if let Ok(head) = git.head() { 81 | if let Some(target) = head.target() { 82 | branch_name = git.find_object(target, Some(ObjectType::Any)) 83 | .ok() 84 | .and_then(|obj| obj.short_id().ok()) 85 | .and_then(|buf| buf.as_str() 86 | .map(|s| s.to_string())) 87 | } 88 | } else { 89 | p.segments.push(Segment::new(p.theme.git_dirty_bg, p.theme.git_dirty_fg, "Big Bang")); 90 | return; 91 | } 92 | } 93 | 94 | if !statuses_if_none(git, &mut p.git_statuses) { 95 | return; 96 | } 97 | let statuses = p.git_statuses.as_ref().unwrap(); 98 | 99 | let (mut bg, mut fg) = (p.theme.git_dirty_bg, p.theme.git_dirty_fg); 100 | if statuses.is_empty() { 101 | bg = p.theme.git_clean_bg; 102 | fg = p.theme.git_clean_fg; 103 | } 104 | p.segments.push(Segment::new(bg, fg, branch_name.unwrap())); 105 | 106 | #[cfg(feature = "flame")] 107 | let _guard = flame::start_guard("checking remotes"); 108 | 109 | if let Some(local) = local { 110 | if let Some(upstream) = upstream { 111 | if let Ok((ahead, behind)) = git.graph_ahead_behind(local, upstream) { 112 | if ahead > 0 { 113 | let mut ahead = if ahead == 1 { String::new() } else { ahead.to_string() }; 114 | ahead.push(p.theme.git_ahead_char); 115 | p.segments.push(Segment::new(p.theme.git_ahead_bg, p.theme.git_ahead_fg, ahead)); 116 | } 117 | 118 | if behind > 0 { 119 | let mut behind = if behind == 1 { String::new() } else { behind.to_string() }; 120 | behind.push(p.theme.git_behind_char); 121 | p.segments.push(Segment::new(p.theme.git_behind_bg, p.theme.git_behind_fg, behind)); 122 | } 123 | } 124 | } 125 | } 126 | } 127 | pub fn segment_gitstage(p: &mut Powerline) { 128 | #[cfg(feature = "flame")] 129 | let _guard = flame::start_guard("segment gitstage"); 130 | 131 | if !discover_if_none(&mut p.git) { 132 | return; 133 | } 134 | let git = p.git.as_ref().unwrap(); 135 | 136 | if !statuses_if_none(git, &mut p.git_statuses) { 137 | return; 138 | } 139 | let statuses = p.git_statuses.as_ref().unwrap(); 140 | 141 | #[cfg(feature = "flame")] 142 | flame::start("counting"); 143 | 144 | let mut staged = 0; 145 | let mut notstaged = 0; 146 | let mut untracked = 0; 147 | let mut conflicted = 0; 148 | 149 | for status in statuses { 150 | if status.contains(Status::INDEX_NEW) 151 | || status.contains(Status::INDEX_MODIFIED) 152 | || status.contains(Status::INDEX_TYPECHANGE) 153 | || status.contains(Status::INDEX_RENAMED) 154 | || status.contains(Status::INDEX_DELETED) { 155 | staged += 1; 156 | } 157 | if status.contains(Status::WT_MODIFIED) 158 | || status.contains(Status::WT_TYPECHANGE) 159 | || status.contains(Status::WT_DELETED) { 160 | notstaged += 1; 161 | } 162 | if status.contains(Status::WT_NEW) { 163 | untracked += 1; 164 | } 165 | if status.contains(Status::CONFLICTED) { 166 | conflicted += 1; 167 | } 168 | } 169 | 170 | #[cfg(feature = "flame")] 171 | flame::end("counting"); 172 | 173 | if staged > 0 { 174 | let mut string = if staged == 1 { String::with_capacity(1) } else { staged.to_string() }; 175 | string.push(p.theme.git_staged_char); 176 | p.segments.push(Segment::new(p.theme.git_staged_bg, p.theme.git_staged_fg, string)); 177 | } 178 | if notstaged > 0 { 179 | let mut string = if notstaged == 1 { String::with_capacity(1) } else { notstaged.to_string() }; 180 | string.push(p.theme.git_notstaged_char); 181 | p.segments.push(Segment::new(p.theme.git_notstaged_bg, p.theme.git_notstaged_fg, string)); 182 | } 183 | if untracked > 0 { 184 | let mut string = if untracked == 1 { String::with_capacity(1) } else { untracked.to_string() }; 185 | string.push(p.theme.git_untracked_char); 186 | p.segments.push(Segment::new(p.theme.git_untracked_bg, p.theme.git_untracked_fg, string)); 187 | } 188 | if conflicted > 0 { 189 | let mut string = if conflicted == 1 { String::with_capacity(1) } else { conflicted.to_string() }; 190 | string.push(p.theme.git_conflicted_char); 191 | p.segments.push(Segment::new(p.theme.git_conflicted_bg, p.theme.git_conflicted_fg, string)); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /src/segments/segment_host.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | borrow::Cow, 3 | os::raw::{c_char, c_int}, 4 | str 5 | }; 6 | use crate::{Powerline, Segment, Shell}; 7 | 8 | extern "C" { 9 | fn gethostname(buf: *mut c_char, len: usize) -> c_int; 10 | } 11 | 12 | pub fn segment_host(p: &mut Powerline) { 13 | let (bg, fg) = (p.theme.hostname_bg, p.theme.hostname_fg); 14 | 15 | if p.shell == Shell::Bare { 16 | // We don't want to dont_escape() here 17 | let mut name = [0u8; 256]; 18 | let mut string = Cow::from("error"); 19 | if unsafe { gethostname(&mut name[0] as *mut _ as *mut c_char, name.len()) } == 0 { 20 | let len = name.iter().position(|i| *i == 0).unwrap_or(name.len()); 21 | 22 | if let Ok(name) = str::from_utf8(&name[..len]) { 23 | string = Cow::from(String::from(name)); 24 | } 25 | } 26 | p.segments.push(Segment::new(bg, fg, string)); 27 | return; 28 | } 29 | 30 | p.segments.push(Segment::new(bg, fg, match p.shell { 31 | Shell::Bare => unreachable!(), 32 | Shell::Bash => "\\h", 33 | Shell::Zsh => "%m" 34 | }).dont_escape()); 35 | } 36 | -------------------------------------------------------------------------------- /src/segments/segment_jobs.rs: -------------------------------------------------------------------------------- 1 | use crate::{Powerline, Segment, Shell}; 2 | 3 | pub fn segment_jobs(p: &mut Powerline) { 4 | p.segments.push(match p.shell { 5 | Shell::Bare => return, 6 | Shell::Bash => 7 | Segment::new(p.theme.jobs_bg, p.theme.jobs_fg, "\\j") 8 | .with_before(r#"$(test -n "$(jobs -p)" && echo -n ""#) 9 | .with_after(r#"")"#), 10 | Shell::Zsh => 11 | Segment::new(p.theme.jobs_bg, p.theme.jobs_fg, "%j") 12 | .with_before("%(1j.") 13 | .with_after(".)"), 14 | }.into_conditional().dont_escape()); 15 | } 16 | -------------------------------------------------------------------------------- /src/segments/segment_linebreak.rs: -------------------------------------------------------------------------------- 1 | use std::borrow::Cow; 2 | use crate::{Powerline, Segment, Shell}; 3 | 4 | pub fn segment_linebreak(p: &mut Powerline) { 5 | let (bg, fg) = (0, 0); 6 | p.segments.push(match p.shell { 7 | Shell::Bare => Segment::new(bg, fg, "\n").dont_escape().with_no_space_after(), 8 | Shell::Bash => Segment::new(bg, fg, "\n").dont_escape().with_no_space_after(), 9 | Shell::Zsh => Segment::new(bg, fg, "\n").dont_escape().with_no_space_after(), 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /src/segments/segment_nix.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use crate::{Powerline, Segment}; 3 | 4 | pub fn segment_nix(p: &mut Powerline) { 5 | // TODO: Generalize this to any environment variable? 6 | if let Ok(val) = env::var("IN_NIX_SHELL") { 7 | p.segments.push(Segment::new( 8 | p.theme.nixshell_bg, 9 | p.theme.nixshell_fg, 10 | val 11 | )); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/segments/segment_perms.rs: -------------------------------------------------------------------------------- 1 | use std::os::raw::{c_char, c_int}; 2 | use crate::{Powerline, Segment}; 3 | 4 | const W_OK: c_int = 2; 5 | 6 | extern "C" { 7 | fn access(pathname: *const c_char, mode: c_int) -> c_int; 8 | } 9 | 10 | pub fn segment_perms(p: &mut Powerline) { 11 | if unsafe { access(".\0".as_ptr() as *const c_char, W_OK) } != 0 { 12 | p.segments.push(Segment::new(p.theme.ro_bg, p.theme.ro_fg, p.theme.ro_char.to_string())); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/segments/segment_ps.rs: -------------------------------------------------------------------------------- 1 | use crate::{Powerline, Segment}; 2 | use std::{ 3 | fmt::Write, 4 | fs, 5 | os::raw::c_int, 6 | path::Path 7 | }; 8 | 9 | const PROC_STAT_PID: usize = 6; // 0-based, 7th word 10 | 11 | extern "C" { 12 | fn getpid() -> c_int; // std::process::id() is unstable 13 | } 14 | 15 | pub fn segment_ps(p: &mut Powerline) { 16 | let pid = unsafe { getpid() }; 17 | let tty = { 18 | let mut path = String::with_capacity(6 + 4 + 5); // 4 = reserved pid length 19 | path.push_str("/proc/"); 20 | write!(path, "{}", pid).unwrap(); 21 | path.push_str("/stat"); 22 | 23 | match get_process_tty(&Path::new(&path)) { 24 | Some(tty) => tty, 25 | None => return 26 | } 27 | }; 28 | 29 | let mut count = -1isize; 30 | 31 | if let Ok(list) = fs::read_dir("/proc/") { 32 | for entry in list { 33 | let entry = match entry { 34 | Ok(entry) => entry, 35 | Err(_) => break 36 | }; 37 | let mut path = entry.path(); 38 | 39 | if !path.file_name() 40 | .and_then(|name| name 41 | .to_str() 42 | .map(|s| { 43 | s.chars().all(|c| c >= '0' && c <= '9') 44 | && s.parse() != Ok(pid) 45 | })) 46 | .unwrap_or(false) { 47 | continue; 48 | } 49 | 50 | path.push("stat"); 51 | 52 | if get_process_tty(&path) == Some(tty) { 53 | count += 1; 54 | } 55 | } 56 | } 57 | 58 | if count > 0 { 59 | p.segments.push(Segment::new(p.theme.ps_bg, p.theme.ps_fg, count.to_string())); 60 | } 61 | } 62 | pub fn get_process_tty(file: &Path) -> Option { 63 | fs::read_to_string(&file).ok()? 64 | .split_whitespace().nth(PROC_STAT_PID) 65 | .and_then(|n| n.parse().ok()) 66 | } 67 | -------------------------------------------------------------------------------- /src/segments/segment_root.rs: -------------------------------------------------------------------------------- 1 | use crate::{format, Powerline, Segment}; 2 | 3 | pub fn segment_root(p: &mut Powerline, error: u8) { 4 | let (mut bg, mut fg) = (p.theme.cmd_passed_bg, p.theme.cmd_passed_fg); 5 | if error != 0 { 6 | bg = p.theme.cmd_failed_bg; 7 | fg = p.theme.cmd_failed_fg; 8 | } 9 | p.segments.push(Segment::new(bg, fg, format::root(p.shell)).dont_escape()); 10 | } 11 | -------------------------------------------------------------------------------- /src/segments/segment_ssh.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use crate::{Powerline, Segment}; 3 | 4 | pub fn segment_ssh(p: &mut Powerline) { 5 | if env::var("SSH_CLIENT").is_ok() { 6 | p.segments.push(Segment::new(p.theme.ssh_bg, p.theme.ssh_fg, p.theme.ssh_char.to_string())); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/segments/segment_time.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "chrono")] use chrono::Local; 2 | #[cfg(feature = "chrono")] use std::fmt::Write; 3 | use crate::{Powerline, Segment, Shell}; 4 | 5 | pub fn segment_time(p: &mut Powerline, strftime: &str) { 6 | let (bg, fg) = (p.theme.time_bg, p.theme.time_fg); 7 | if p.shell == Shell::Bare || strftime != crate::cli::TIME_FORMAT_DEFAULT { 8 | #[cfg(feature = "chrono")] 9 | { 10 | let now = Local::now(); 11 | let mut formatted = String::with_capacity(strftime.len()); 12 | write!(formatted, "{}", now.format(strftime)).unwrap(); 13 | // We don't want to dont_escape() here 14 | p.segments.push(Segment::new(bg, fg, formatted)); 15 | } 16 | return; 17 | } 18 | p.segments.push(Segment::new(bg, fg, match p.shell { 19 | Shell::Bare => unreachable!(), 20 | Shell::Bash => "\\@", 21 | Shell::Zsh => "%@" 22 | }).dont_escape()) 23 | } 24 | -------------------------------------------------------------------------------- /src/segments/segment_user.rs: -------------------------------------------------------------------------------- 1 | use std::borrow::Cow; 2 | use crate::{Powerline, Segment, Shell}; 3 | 4 | pub fn segment_user(p: &mut Powerline) { 5 | let (bg, fg) = (p.theme.username_bg, p.theme.username_fg); 6 | #[cfg(feature = "users")] 7 | let mut bg = bg; 8 | let mut fg = fg; 9 | 10 | #[cfg(feature = "users")] 11 | let uid = users::get_current_uid(); 12 | #[cfg(feature = "users")] 13 | { if uid == 0 { 14 | bg = p.theme.username_root_bg; 15 | fg = p.theme.username_root_fg; 16 | } } 17 | 18 | p.segments.push(match p.shell { 19 | Shell::Bare => Segment::new( 20 | bg, 21 | fg, 22 | { 23 | #[cfg(not(feature = "users"))] 24 | { Cow::from("error") } 25 | #[cfg(feature = "users")] 26 | { if let Some(user) = users::get_user_by_uid(uid) { 27 | if let Some(name) = user.name().to_str() { 28 | Cow::from(String::from(name)) 29 | } else { 30 | Cow::from("error") 31 | } 32 | } else { 33 | Cow::from("error") 34 | } } 35 | } 36 | ), 37 | Shell::Bash => Segment::new(bg, fg, "\\u").dont_escape(), 38 | Shell::Zsh => Segment::new(bg, fg, "%n").dont_escape(), 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /src/segments/segment_virtualenv.rs: -------------------------------------------------------------------------------- 1 | use std::{env, path}; 2 | use crate::{Powerline, Segment}; 3 | 4 | pub fn segment_virtualenv(p: &mut Powerline) { 5 | if let Ok(Some(virtual_env_name)) = env::var("VIRTUAL_ENV") 6 | .or_else(|_| env::var("CONDA_ENV_PATH")) 7 | .or_else(|_| env::var("CONDA_DEFAULT_ENV")) 8 | .map(|env_path| { 9 | path::Path::new(&env_path) 10 | .file_name() 11 | .and_then(|env_name| Some(env_name.to_string_lossy().into_owned())) 12 | }) { 13 | p.segments.push(Segment::new( 14 | p.theme.virtual_env_bg, 15 | p.theme.virtual_env_fg, 16 | virtual_env_name, 17 | )); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/theme.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone)] 2 | pub struct Theme { 3 | pub separator_fg: u8, 4 | 5 | pub home_bg: u8, 6 | pub home_fg: u8, 7 | pub path_bg: u8, 8 | pub path_fg: u8, 9 | pub cwd_fg: u8, 10 | 11 | pub username_bg: u8, 12 | pub username_fg: u8, 13 | pub username_root_bg: u8, 14 | pub username_root_fg: u8, 15 | pub hostname_bg: u8, 16 | pub hostname_fg: u8, 17 | 18 | pub jobs_bg: u8, 19 | pub jobs_fg: u8, 20 | 21 | pub time_bg: u8, 22 | pub time_fg: u8, 23 | 24 | pub ssh_bg: u8, 25 | pub ssh_fg: u8, 26 | 27 | pub ssh_char: char, 28 | 29 | pub ro_bg: u8, 30 | pub ro_fg: u8, 31 | 32 | pub ro_char: char, 33 | 34 | pub git_clean_bg: u8, 35 | pub git_clean_fg: u8, 36 | pub git_dirty_bg: u8, 37 | pub git_dirty_fg: u8, 38 | pub git_ahead_bg: u8, 39 | pub git_ahead_fg: u8, 40 | pub git_behind_bg: u8, 41 | pub git_behind_fg: u8, 42 | pub git_conflicted_bg: u8, 43 | pub git_conflicted_fg: u8, 44 | pub git_notstaged_bg: u8, 45 | pub git_notstaged_fg: u8, 46 | pub git_staged_bg: u8, 47 | pub git_staged_fg: u8, 48 | pub git_untracked_bg: u8, 49 | pub git_untracked_fg: u8, 50 | 51 | pub git_ahead_char: char, 52 | pub git_behind_char: char, 53 | pub git_staged_char: char, 54 | pub git_notstaged_char: char, 55 | pub git_untracked_char: char, 56 | pub git_conflicted_char: char, 57 | 58 | pub cmd_passed_bg: u8, 59 | pub cmd_passed_fg: u8, 60 | pub cmd_failed_bg: u8, 61 | pub cmd_failed_fg: u8, 62 | 63 | pub ps_bg: u8, 64 | pub ps_fg: u8, 65 | 66 | pub virtual_env_bg: u8, 67 | pub virtual_env_fg: u8, 68 | 69 | pub nixshell_bg: u8, 70 | pub nixshell_fg: u8, 71 | } 72 | 73 | pub const DEFAULT: Theme = Theme { 74 | separator_fg: 244, 75 | 76 | home_bg: 31, 77 | home_fg: 15, 78 | path_bg: 237, 79 | path_fg: 250, 80 | cwd_fg: 254, 81 | 82 | username_bg: 240, 83 | username_fg: 250, 84 | username_root_bg: 124, 85 | username_root_fg: 15, 86 | hostname_bg: 238, 87 | hostname_fg: 250, 88 | 89 | jobs_bg: 238, 90 | jobs_fg: 39, 91 | ps_bg: 238, 92 | ps_fg: 39, 93 | 94 | time_bg: 238, 95 | time_fg: 250, 96 | 97 | ssh_bg: 166, 98 | ssh_fg: 254, 99 | 100 | ssh_char: '', 101 | 102 | ro_bg: 124, 103 | ro_fg: 254, 104 | 105 | ro_char: '', 106 | 107 | git_clean_bg: 148, 108 | git_clean_fg: 0, 109 | git_dirty_bg: 161, 110 | git_dirty_fg: 15, 111 | git_ahead_bg: 240, 112 | git_ahead_fg: 250, 113 | git_behind_bg: 240, 114 | git_behind_fg: 250, 115 | git_conflicted_bg: 9, 116 | git_conflicted_fg: 15, 117 | git_notstaged_bg: 130, 118 | git_notstaged_fg: 15, 119 | git_staged_bg: 22, 120 | git_staged_fg: 15, 121 | git_untracked_bg: 52, 122 | git_untracked_fg: 15, 123 | 124 | git_ahead_char: '⬆', 125 | git_behind_char: '⬇', 126 | git_staged_char: '✔', 127 | git_notstaged_char: '✎', 128 | git_untracked_char: '+', 129 | git_conflicted_char: '*', 130 | 131 | cmd_passed_bg: 236, 132 | cmd_passed_fg: 15, 133 | cmd_failed_bg: 161, 134 | cmd_failed_fg: 15, 135 | 136 | virtual_env_bg: 35, 137 | virtual_env_fg: 0, 138 | 139 | nixshell_bg: 237, 140 | nixshell_fg: 130, 141 | }; 142 | 143 | use std::error::Error as StdError; 144 | use std::fmt; 145 | use std::fs::File; 146 | use std::io::{BufRead, BufReader}; 147 | 148 | #[derive(Debug)] 149 | pub struct ErrCorrupt; 150 | 151 | impl StdError for ErrCorrupt {} 152 | impl fmt::Display for ErrCorrupt { 153 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 154 | write!(f, "Corrupt theme file") 155 | } 156 | } 157 | 158 | pub fn load(file: &str) -> Result> { 159 | let file = File::open(file)?; 160 | let reader = BufReader::new(file); 161 | 162 | let mut theme = DEFAULT.clone(); 163 | 164 | for line in reader.lines() { 165 | let line = line?; 166 | if line.starts_with('#') || line.chars().all(char::is_whitespace) { 167 | continue; 168 | } 169 | let mut parts = line.splitn(2, '='); 170 | 171 | let variable = parts.next().map(|inner| inner.trim()).ok_or_else(|| ErrCorrupt)?; 172 | let value = parts.next().map(|inner| inner.trim()).ok_or_else(|| ErrCorrupt)?; 173 | 174 | if variable.ends_with("char") { 175 | let index = theme_index_char(&mut theme, variable).ok_or_else(|| ErrCorrupt)?; 176 | 177 | if value.chars().count() == 1 { 178 | *index = value.parse()?; 179 | } else { 180 | let codepoint = u32::from_str_radix(value, 16)?; 181 | *index = std::char::from_u32(codepoint).ok_or_else(|| ErrCorrupt)?; 182 | } 183 | } else { 184 | let index = theme_index_u8(&mut theme, variable).ok_or_else(|| ErrCorrupt)?; 185 | *index = value.parse()?; 186 | } 187 | } 188 | 189 | Ok(theme) 190 | } 191 | 192 | fn theme_index_u8<'a>(theme: &'a mut Theme, name: &str) -> Option<&'a mut u8> { 193 | match name { 194 | "separator_fg" => Some(&mut theme.separator_fg), 195 | 196 | "home_bg" => Some(&mut theme.home_bg), 197 | "home_fg" => Some(&mut theme.home_fg), 198 | "path_bg" => Some(&mut theme.path_bg), 199 | "path_fg" => Some(&mut theme.path_fg), 200 | "cwd_fg" => Some(&mut theme.cwd_fg), 201 | 202 | "username_bg" => Some(&mut theme.username_bg), 203 | "username_fg" => Some(&mut theme.username_fg), 204 | "username_root_bg" => Some(&mut theme.username_root_bg), 205 | "username_root_fg" => Some(&mut theme.username_root_fg), 206 | "hostname_bg" => Some(&mut theme.hostname_bg), 207 | "hostname_fg" => Some(&mut theme.hostname_fg), 208 | 209 | "jobs_bg" => Some(&mut theme.jobs_bg), 210 | "jobs_fg" => Some(&mut theme.jobs_fg), 211 | 212 | "time_bg" => Some(&mut theme.time_bg), 213 | "time_fg" => Some(&mut theme.time_fg), 214 | 215 | "ssh_bg" => Some(&mut theme.ssh_bg), 216 | "ssh_fg" => Some(&mut theme.ssh_fg), 217 | 218 | "ro_bg" => Some(&mut theme.ro_bg), 219 | "ro_fg" => Some(&mut theme.ro_fg), 220 | 221 | "git_clean_bg" => Some(&mut theme.git_clean_bg), 222 | "git_clean_fg" => Some(&mut theme.git_clean_fg), 223 | "git_dirty_bg" => Some(&mut theme.git_dirty_bg), 224 | "git_dirty_fg" => Some(&mut theme.git_dirty_fg), 225 | "git_ahead_bg" => Some(&mut theme.git_ahead_bg), 226 | "git_ahead_fg" => Some(&mut theme.git_ahead_fg), 227 | "git_behind_bg" => Some(&mut theme.git_behind_bg), 228 | "git_behind_fg" => Some(&mut theme.git_behind_fg), 229 | "git_conflicted_bg" => Some(&mut theme.git_conflicted_bg), 230 | "git_conflicted_fg" => Some(&mut theme.git_conflicted_fg), 231 | "git_notstaged_bg" => Some(&mut theme.git_notstaged_bg), 232 | "git_notstaged_fg" => Some(&mut theme.git_notstaged_fg), 233 | "git_staged_bg" => Some(&mut theme.git_staged_bg), 234 | "git_staged_fg" => Some(&mut theme.git_staged_fg), 235 | "git_untracked_bg" => Some(&mut theme.git_untracked_bg), 236 | "git_untracked_fg" => Some(&mut theme.git_untracked_fg), 237 | 238 | "cmd_passed_bg" => Some(&mut theme.cmd_passed_bg), 239 | "cmd_passed_fg" => Some(&mut theme.cmd_passed_fg), 240 | "cmd_failed_bg" => Some(&mut theme.cmd_failed_bg), 241 | "cmd_failed_fg" => Some(&mut theme.cmd_failed_fg), 242 | 243 | "virtual_env_bg" => Some(&mut theme.virtual_env_bg), 244 | "virtual_env_fg" => Some(&mut theme.virtual_env_fg), 245 | 246 | "nixshell_bg" => Some(&mut theme.nixshell_bg), 247 | "nixshell_fg" => Some(&mut theme.nixshell_fg), 248 | 249 | _ => None 250 | } 251 | } 252 | 253 | fn theme_index_char<'a>(theme: &'a mut Theme, name: &str) -> Option<&'a mut char> { 254 | match name { 255 | "ssh_char" => Some(&mut theme.ssh_char), 256 | "ro_char" => Some(&mut theme.ro_char), 257 | 258 | "git_ahead_char" => Some(&mut theme.git_ahead_char), 259 | "git_behind_char" => Some(&mut theme.git_behind_char), 260 | "git_staged_char" => Some(&mut theme.git_staged_char), 261 | "git_notstaged_char" => Some(&mut theme.git_notstaged_char), 262 | "git_untracked_char" => Some(&mut theme.git_untracked_char), 263 | "git_conflicted_char" => Some(&mut theme.git_conflicted_char), 264 | 265 | _ => None 266 | } 267 | } 268 | --------------------------------------------------------------------------------