From 2db2f446c27b7be976822cf4d502857a0f522b2f Mon Sep 17 00:00:00 2001 From: ProminentRetail Date: Wed, 8 Nov 2023 01:14:11 +1100 Subject: [PATCH] nixos/git: add prompt.enable --- nixos/modules/programs/git.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/programs/git.nix b/nixos/modules/programs/git.nix index 4e271a8c134b..710dee349d59 100644 --- a/nixos/modules/programs/git.nix +++ b/nixos/modules/programs/git.nix @@ -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 ];