Enable transience feature for starship.
This commit is contained in:
parent
a3edfa91e9
commit
c538cb8211
1 changed files with 29 additions and 16 deletions
|
|
@ -4,27 +4,40 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.youthlic.programs.starship;
|
cfg = config.youthlic.programs.starship;
|
||||||
|
fish-cfg = config.youthlic.programs.fish;
|
||||||
|
bash-cfg = config.youthlic.programs.bash;
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
youthlic.programs.starship = {
|
youthlic.programs.starship = {
|
||||||
enable = lib.mkEnableOption "starship";
|
enable = lib.mkEnableOption "starship";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkMerge [
|
||||||
programs.starship = lib.mkMerge [
|
(
|
||||||
{
|
lib.mkIf cfg.enable {
|
||||||
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableTransience = true;
|
||||||
settings = let
|
settings = let
|
||||||
config-file = builtins.readFile ./config.toml;
|
config-file = builtins.readFile ./config.toml;
|
||||||
in
|
in
|
||||||
builtins.fromTOML config-file;
|
builtins.fromTOML config-file;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
(lib.mkIf config.youthlic.programs.fish.enable {
|
)
|
||||||
enableFishIntegration = true;
|
(lib.mkIf (cfg.enable && fish-cfg.enable) {
|
||||||
|
programs.starship.enableFishIntegration = true;
|
||||||
|
programs.fish.functions = {
|
||||||
|
starship_transient_prompt_func = ''
|
||||||
|
starship module character
|
||||||
|
'';
|
||||||
|
starship_transient_rprompt_func = ''
|
||||||
|
starship module time
|
||||||
|
'';
|
||||||
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf config.youthlic.programs.bash.enable {
|
(lib.mkIf (cfg.enable && bash-cfg.enable) {
|
||||||
enableBashIntegration = true;
|
programs.starship.enableBashIntegration = true;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue