nixos-config/home/git.nix

68 lines
1.5 KiB
Nix
Raw Normal View History

2022-04-10 11:54:58 +02:00
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
2022-01-11 16:08:21 +01:00
mkEnableOption
mkIf
2022-04-10 11:54:58 +02:00
;
2022-01-11 16:08:21 +01:00
2021-07-29 11:07:14 +02:00
cfg = config.my.home.git;
2022-04-10 11:54:58 +02:00
in {
options.my.home.git.enable = (mkEnableOption "Git configuration") // {default = true;};
2021-07-29 11:07:14 +02:00
2022-01-11 16:08:21 +01:00
config = mkIf cfg.enable {
2021-07-29 11:07:14 +02:00
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 = {
2022-04-10 11:54:58 +02:00
commit = {verbose = true;};
core = {editor = "vim";};
init = {defaultBranch = "main";};
pull = {rebase = true;};
rerere = {enabled = true;};
2021-07-29 11:07:14 +02:00
};
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/";
2022-04-10 11:54:58 +02:00
contents = {user = {email = "amartin@lrde.epita.fr";};};
2021-07-29 11:07:14 +02:00
}
{
2021-08-03 13:18:42 +02:00
condition = "gitdir:~/work/prologin/";
2022-04-10 11:54:58 +02:00
contents = {user = {email = "antoine.martin@prologin.org";};};
2021-07-29 11:07:14 +02:00
}
{
2021-08-03 13:18:42 +02:00
condition = "gitdir:~/work/epita/";
2022-04-10 11:54:58 +02:00
contents = {user = {email = "antoine4.martin@epita.fr";};};
2021-07-29 11:07:14 +02:00
}
];
2022-11-27 15:45:40 +01:00
ignores = [
"/.direnv/"
"/.envrc"
];
2021-07-29 11:07:14 +02:00
};
};
}