{
config,
lib,
pkgs,
...
}: let
cfg = config.roles.shell;
in {
options.roles.shell = {
enable = lib.mkEnableOption "an opnionated shell environment";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
elvish
ripgrep
fd
btop
sl
];
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
hm = {
home.file = {
".config/elvish/lib/direnv.elv" = {
executable = true;
source = ./direnv.elv;
};
".config/elvish/rc.elv" = {
executable = true;
text = ''
#!/usr/bin/env elvish
use direnv
eval (starship init elvish)
'';
};
};
programs.bash = {
enable = true;
bashrcExtra = ''
eval "$(direnv hook bash)"
eval "$(starship init bash)"
'';
};
programs.starship = {
enable = true;
settings = {
add_newline = false;
scan_timeout = 10;
/*
format = lib.concatStrings [
"$line_break"
"$shell"
"$nix_shell"
"$directory"
"$character"
];
#format_right = lib.concatStrings [
#
#];
character = {
success_symbol = " >";
error_symbol = " >";
};
directory = {
truncation_length = 3;
truncate_to_repo = true;
format = "[$path](bold cyan)";
};
*/
shell = {
disabled = false;
bash_indicator = "bsh";
elvish_indicator = "elv";
};
};
};
};
};
}