Enable transience feature for starship.
This commit is contained in:
parent
a80c2ef2c8
commit
91bafef163
4 changed files with 53 additions and 16 deletions
|
|
@ -4,27 +4,44 @@
|
||||||
...
|
...
|
||||||
}: 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 {
|
||||||
enable = true;
|
programs.starship = {
|
||||||
settings = let
|
enable = true;
|
||||||
config-file = builtins.readFile ./config.toml;
|
enableTransience = true;
|
||||||
in
|
settings = let
|
||||||
builtins.fromTOML config-file;
|
config-file = builtins.readFile ./config.toml;
|
||||||
|
in
|
||||||
|
builtins.fromTOML config-file;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
(lib.mkIf config.youthlic.programs.fish.enable {
|
)
|
||||||
enableFishIntegration = true;
|
(lib.mkIf (cfg.enable && fish-cfg.enable) {
|
||||||
})
|
programs.starship.enableFishIntegration = true;
|
||||||
(lib.mkIf config.youthlic.programs.bash.enable {
|
programs.fish.functions = {
|
||||||
enableBashIntegration = true;
|
starship_transient_prompt_func = ''
|
||||||
})
|
starship module character
|
||||||
];
|
'';
|
||||||
};
|
starship_transient_rprompt_func = ''
|
||||||
|
starship module time
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf (cfg.enable && bash-cfg.enable) {
|
||||||
|
programs.starship.enableBashIntegration = true;
|
||||||
|
programs.bash.bashrcExtra = ''
|
||||||
|
bleopt prompt_ps1_final='$(starship module character)'
|
||||||
|
bleopt prompt_rps1_final='$(starship module time)'
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
hardware.asus.enable = true;
|
hardware.asus.enable = true;
|
||||||
i18n.enable = true;
|
i18n.enable = true;
|
||||||
programs = {
|
programs = {
|
||||||
|
bash.enable = true;
|
||||||
guix.enable = true;
|
guix.enable = true;
|
||||||
dae.enable = true;
|
dae.enable = true;
|
||||||
openssh.enable = true;
|
openssh.enable = true;
|
||||||
|
|
|
||||||
18
nixos/modules/programs/bash.nix
Normal file
18
nixos/modules/programs/bash.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.bash;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.bash = {
|
||||||
|
enable = lib.mkEnableOption "bash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.bash = {
|
||||||
|
blesh.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -29,5 +29,6 @@
|
||||||
./supergfxd.nix
|
./supergfxd.nix
|
||||||
./radicle.nix
|
./radicle.nix
|
||||||
./wshowkeys.nix
|
./wshowkeys.nix
|
||||||
|
./bash.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue