1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-07 19:10:47 +00:00
starship/src/configs/nix_shell.rs
David Knaack d06ba072a8
feat(config): allow printing default and computed config (#2521)
* feat: allow printing default and computed config

* fix custom modules

* actually fix custom modules
2021-03-31 17:31:55 +02:00

31 lines
905 B
Rust

use crate::config::ModuleConfig;
use serde::Serialize;
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig, Serialize)]
pub struct NixShellConfig<'a> {
pub format: &'a str,
pub symbol: &'a str,
pub style: &'a str,
pub impure_msg: &'a str,
pub pure_msg: &'a str,
pub disabled: bool,
}
/* The trailing double spaces in `symbol` are needed to work around issues with
multiwidth emoji support in some shells. Please do not file a PR to change this
unless you can show that your changes do not affect this workaround. */
impl<'a> Default for NixShellConfig<'a> {
fn default() -> Self {
NixShellConfig {
format: "via [$symbol$state( \\($name\\))]($style) ",
symbol: "❄️ ",
style: "bold blue",
impure_msg: "impure",
pure_msg: "pure",
disabled: false,
}
}
}