powerline-go: add support for -modules-right
Add modulesRight setting to instruct powerline-go to configure right side prompt. Use eval mode when this setting is set.
This commit is contained in:
parent
fbb80207f3
commit
f46972e466
6 changed files with 112 additions and 10 deletions
|
|
@ -24,7 +24,10 @@ with lib;
|
|||
assertFileExists home-files/.bashrc
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'/bin/powerline-go -error $old_exit_status -modules nix-shell -newline -path-aliases \~/project/foo=prj-foo -ignore-repos /home/me/project1,/home/me/project2'
|
||||
'PS1='
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'/bin/powerline-go -error $old_exit_status -shell bash -modules nix-shell -newline -path-aliases \~/project/foo=prj-foo -ignore-repos /home/me/project1,/home/me/project2'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
34
tests/modules/programs/powerline-go/bashmodulesright.nix
Normal file
34
tests/modules/programs/powerline-go/bashmodulesright.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs = {
|
||||
bash.enable = true;
|
||||
|
||||
powerline-go = {
|
||||
enable = true;
|
||||
newline = true;
|
||||
modules = [ "nix-shell" ];
|
||||
modulesRight = [ "git" ];
|
||||
pathAliases = { "\\~/project/foo" = "prj-foo"; };
|
||||
settings = {
|
||||
ignore-repos = [ "/home/me/project1" "/home/me/project2" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.powerline-go = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'eval'
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
'/bin/powerline-go -error $old_exit_status -shell bash -eval -modules nix-shell -modules-right git -newline -path-aliases \~/project/foo=prj-foo -ignore-repos /home/me/project1,/home/me/project2'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -2,4 +2,6 @@
|
|||
powerline-go-bash = ./bash.nix;
|
||||
powerline-go-zsh = ./zsh.nix;
|
||||
powerline-go-fish = ./fish.nix;
|
||||
powerline-go-bashmodulesright = ./bashmodulesright.nix;
|
||||
powerline-go-zshmodulesright = ./zshmodulesright.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ with lib;
|
|||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'PS1='
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'/bin/powerline-go -error $? -shell zsh -modules nix-shell -newline -path-aliases \~/project/foo=prj-foo -ignore-repos /home/me/project1,/home/me/project2'
|
||||
|
|
|
|||
37
tests/modules/programs/powerline-go/zshmodulesright.nix
Normal file
37
tests/modules/programs/powerline-go/zshmodulesright.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
|
||||
powerline-go = {
|
||||
enable = true;
|
||||
newline = true;
|
||||
modules = [ "nix-shell" ];
|
||||
modulesRight = [ "git" ];
|
||||
pathAliases = { "\\~/project/foo" = "prj-foo"; };
|
||||
settings = {
|
||||
ignore-repos = [ "/home/me/project1" "/home/me/project2" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs = {
|
||||
powerline-go = { };
|
||||
zsh = { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'eval'
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'/bin/powerline-go -error $? -shell zsh -eval -modules nix-shell -modules-right git -newline -path-aliases \~/project/foo=prj-foo -ignore-repos /home/me/project1,/home/me/project2'
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue