From e24066e5779fd6e40e7eb0018114090716467e9c Mon Sep 17 00:00:00 2001 From: Jan-Bulthuis Date: Mon, 2 Dec 2024 00:52:22 +0100 Subject: [PATCH] Added module for git --- modules/users/modules/git/default.nix | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 modules/users/modules/git/default.nix diff --git a/modules/users/modules/git/default.nix b/modules/users/modules/git/default.nix new file mode 100644 index 0000000..4c569e7 --- /dev/null +++ b/modules/users/modules/git/default.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + pkgs, + ... +}: + +with lib; +let + cfg = config.modules.git; +in +{ + options.modules.git = { + enable = mkEnableOption "git"; + + user = mkOption { + type = types.str; + description = "Default user name to use."; + }; + + email = mkOption { + type = types.str; + description = "Default user email to use."; + }; + + ignores = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "Paths to globally ignore"; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + git + lazygit + ]; + + programs.git = { + enable = true; + + extraConfig = { + pull = { + rebase = false; + }; + }; + + userName = cfg.user; + userEmail = cfg.email; + ignores = cfg.ignores; + }; + }; +}