nixos/git: add prompt.enable

This commit is contained in:
ProminentRetail 2023-11-08 01:14:11 +11:00 committed by Maciej Krüger
parent b2063364e1
commit 2db2f446c2
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F

View file

@ -58,6 +58,10 @@ in
'';
};
prompt = {
enable = mkEnableOption "automatically sourcing git-prompt.sh. This does not change $PS1; it simply provides relevant utility functions";
};
lfs = {
enable = mkEnableOption (lib.mdDoc "git-lfs");
@ -89,6 +93,11 @@ in
};
};
})
(mkIf (cfg.enable && cfg.prompt.enable) {
environment.interactiveShellInit = ''
source ${cfg.package}/share/bash-completion/completions/git-prompt.sh
'';
})
];
meta.maintainers = with maintainers; [ figsoda ];