mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 05:03:09 +00:00
powerline-go: add fish integration
This commit is contained in:
parent
7f976da068
commit
ab6517d34a
3 changed files with 51 additions and 0 deletions
|
@ -140,5 +140,14 @@ in {
|
|||
install_powerline_precmd
|
||||
fi
|
||||
'';
|
||||
|
||||
# https://github.com/justjanne/powerline-go#fish
|
||||
programs.fish.promptInit =
|
||||
mkIf (cfg.enable && config.programs.fish.enable) ''
|
||||
function fish_prompt
|
||||
eval ${pkgs.powerline-go}/bin/powerline-go -error $status -jobs (count (jobs -p)) ${commandLineArguments}
|
||||
${cfg.extraUpdatePS1}
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
powerline-go-bash = ./bash.nix;
|
||||
powerline-go-zsh = ./zsh.nix;
|
||||
powerline-go-fish = ./fish.nix;
|
||||
}
|
||||
|
|
41
tests/modules/programs/powerline-go/fish.nix
Normal file
41
tests/modules/programs/powerline-go/fish.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
|
||||
powerline-go = {
|
||||
enable = true;
|
||||
newline = true;
|
||||
modules = [ "nix-shell" ];
|
||||
pathAliases = { "\\~/project/foo" = "prj-foo"; };
|
||||
settings = {
|
||||
ignore-repos = [ "/home/me/project1" "/home/me/project2" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Needed to avoid error with dummy fish package.
|
||||
xdg.dataFile."fish/home-manager_generated_completions".source =
|
||||
mkForce (builtins.toFile "empty" "");
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super:
|
||||
let dummy = pkgs.writeScriptBin "dummy" "";
|
||||
in {
|
||||
powerline-go = dummy;
|
||||
fish = dummy;
|
||||
})
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/fish/config.fish
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
'/bin/powerline-go -error $status -jobs (count (jobs -p)) -modules nix-shell -newline -path-aliases \~/project/foo=prj-foo -ignore-repos /home/me/project1,/home/me/project2'
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue