From fcc60b84e5e3cc44986d40af63f5de488caae909 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 3 Feb 2024 19:27:26 -0500 Subject: make everything a module --- users/seth/module/programs/git.nix | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 users/seth/module/programs/git.nix (limited to 'users/seth/module/programs/git.nix') diff --git a/users/seth/module/programs/git.nix b/users/seth/module/programs/git.nix new file mode 100644 index 0000000..8ba6587 --- /dev/null +++ b/users/seth/module/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 = true;}; + gh.enable = lib.mkEnableOption "GitHub CLI support" // {default = true;}; + }; + + 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 = "getchoo@tuta.io"; + userName = "seth"; + }; + }; + }; +} -- cgit v1.2.3