os/shared/home/bash.nix

44 lines
809 B
Nix
Raw Normal View History

2023-05-21 22:26:26 +02:00
# Configuration of the shell.
2023-05-22 00:45:36 +02:00
# TODO: switch to a shell from this century
2023-05-21 21:15:04 +02:00
{ pkgs, lib, config, ... }:
2023-05-22 00:45:36 +02:00
let cfg = config.custom.bash;
2023-05-21 21:15:04 +02:00
in with lib; {
2023-05-22 00:45:36 +02:00
options.custom.bash = with types; {
2023-05-21 21:15:04 +02:00
extraAliases = mkOption {
default = {};
};
};
config = {
# Configure the shell itself
2023-05-22 00:45:36 +02:00
programs.bash = {
2023-05-21 21:15:04 +02:00
enable = true;
2023-05-22 01:38:26 +02:00
shellAliases = {
":q" = "exit";
"t" = "exa -T";
} // cfg.extraAliases;
2023-05-21 21:15:04 +02:00
};
2023-05-21 22:26:26 +02:00
# Configure the prompt
2023-05-22 01:38:26 +02:00
programs.starship = {
enable = true;
settings = {
format = ''
$directory$git_branch$cmd_duration$sudo
$character
'';
character = {
success_symbol = "[>](bold green)";
error_symbol = "[](bold red)";
};
};
};
2023-05-21 21:15:04 +02:00
};
}