summaryrefslogtreecommitdiffstats
path: root/src/configs/nix_shell.rs
blob: d5316b6aef9f5b7f5e725a5ed9bfff47ccf3d740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig};

use ansi_term::{Color, Style};
use starship_module_config_derive::ModuleConfig;

#[derive(Clone, ModuleConfig)]
pub struct NixShellConfig<'a> {
    pub use_name: bool,
    pub impure_msg: SegmentConfig<'a>,
    pub pure_msg: SegmentConfig<'a>,
    pub style: Style,
    pub disabled: bool,
}

impl<'a> RootModuleConfig<'a> for NixShellConfig<'a> {
    fn new() -> Self {
        NixShellConfig {
            use_name: false,
            impure_msg: SegmentConfig::new("impure"),
            pure_msg: SegmentConfig::new("pure"),
            style: Color::Red.bold(),
            disabled: false,
        }
    }
}