nixos-config/home/git.nix

54 lines
1.4 KiB
Nix
Raw Normal View History

2021-07-29 11:07:14 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.git;
in
{
options.my.home.git.enable = (lib.mkEnableOption "Git configuration") // { default = true; };
config = lib.mkIf cfg.enable {
programs.git = {
enable = true;
2021-11-30 14:23:14 +01:00
delta = {
enable = true;
options = {
syntax-theme = "Solarized (light)";
};
};
2021-07-29 11:07:14 +02:00
lfs.enable = true;
userEmail = "antoine@alarsyo.net";
userName = "Antoine Martin";
extraConfig = {
commit = { verbose = true; };
core = { editor = "vim"; };
init = { defaultBranch = "main"; };
pull = { rebase = true; };
rerere = { enabled = true; };
};
aliases = {
push-wip = "push -o ci.skip";
push-merge = "push -o merge_request.create -o merge_request.merge_when_pipeline_succeeds -o merge_request.remove_source_branch";
push-mr = "push -o merge_request.create -o merge_request.remove_source_branch";
};
includes = [
{
2021-08-03 13:18:42 +02:00
condition = "gitdir:~/work/lrde/";
2021-07-29 11:07:14 +02:00
contents = { user = { email = "amartin@lrde.epita.fr"; }; };
}
{
2021-08-03 13:18:42 +02:00
condition = "gitdir:~/work/prologin/";
2021-07-29 11:07:14 +02:00
contents = { user = { email = "antoine.martin@prologin.org"; }; };
}
{
2021-08-03 13:18:42 +02:00
condition = "gitdir:~/work/epita/";
2021-07-29 11:07:14 +02:00
contents = { user = { email = "antoine4.martin@epita.fr"; }; };
}
];
};
};
}