mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Programs/Bash] Add powerline-go to bash by default
This commit is contained in:
parent
72c4333604
commit
908f639003
1 changed files with 24 additions and 0 deletions
24
programs/bash.nix
Normal file
24
programs/bash.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options.aviallon.programs.bash = {
|
||||||
|
powerline = mkOption {
|
||||||
|
description = "Enable powerline prompt";
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
programs.bash.promptInit = mkAfter ''
|
||||||
|
_prompt() {
|
||||||
|
PS1="$(${pkgs.powerline-go}/bin/powerline-go -error $? -jobs $(jobs -p | wc -l))"
|
||||||
|
}
|
||||||
|
if [ "$TERM" != "dumb" ] && [ "$TERM" != "linux" ]; then
|
||||||
|
export PROMPT_COMMAND="_prompt"
|
||||||
|
fi
|
||||||
|
export -f _prompt
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue