summaryrefslogtreecommitdiff
path: root/users/seth/programs/git.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/seth/programs/git.nix')
-rw-r--r--users/seth/programs/git.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/users/seth/programs/git.nix b/users/seth/programs/git.nix
new file mode 100644
index 0000000..674b3c8
--- /dev/null
+++ b/users/seth/programs/git.nix
@@ -0,0 +1,54 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.git;
+in {
+ options.seth.programs.git = {
+ enable = lib.mkEnableOption "Git configuration settings" // {default = config.seth.enable;};
+ gh.enable = lib.mkEnableOption "GitHub CLI support" // {default = cfg.enable;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs = {
+ gh = lib.mkIf cfg.gh.enable {
+ enable = true;
+ settings = {
+ git_protocol = "https";
+ editor = "nvim";
+ prompt = "enabled";
+ # workaround for https://github.com/nix-community/home-manager/issues/474
+ version = 1;
+ };
+
+ gitCredentialHelper = {
+ enable = true;
+ hosts = ["https://github.com" "https://github.example.com"];
+ };
+ };
+
+ git = {
+ enable = true;
+
+ difftastic = {
+ enable = true;
+ background = "dark";
+ display = "inline";
+ };
+
+ extraConfig = {
+ init = {defaultBranch = "main";};
+ };
+
+ signing = {
+ key = "D31BD0D494BBEE86";
+ signByDefault = true;
+ };
+
+ userEmail = "[email protected]";
+ userName = "seth";
+ };
+ };
+ };
+}