feat: create shared git config

This commit is contained in:
Felix Schröter 2020-03-13 21:18:08 +01:00 committed by Felix Schroeter
parent b567c83f95
commit b220300e0c
3 changed files with 44 additions and 22 deletions

38
home/git.nix Normal file
View file

@ -0,0 +1,38 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.programs.git.custom;
in
{
options.programs.git.custom = {
userName = mkOption {
type = types.str;
default = "Felix Tenley";
};
userEmail = mkOption {
type = types.str;
default = "dev@felschr.com";
};
signingKey = mkOption {
type = types.str;
};
};
config = {
programs.git = {
enable = true;
userName = cfg.userName;
userEmail = cfg.userEmail;
ignores = [".direnv"];
signing = {
key = cfg.signingKey;
signByDefault = true;
};
extraConfig = {
pull = { rebase = true; };
rebase = { autoStash = true; };
};
};
};
}