home: git: setup git config
This commit is contained in:
parent
9b4d3852c3
commit
e52d474d85
|
@ -7,6 +7,7 @@
|
|||
./env.nix
|
||||
./fish
|
||||
./flameshot.nix
|
||||
./git.nix
|
||||
./laptop.nix
|
||||
./secrets
|
||||
./starship.nix
|
||||
|
|
47
home/git.nix
Normal file
47
home/git.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ 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;
|
||||
|
||||
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 = [
|
||||
{
|
||||
condition = "gitdir:~/work/lrde";
|
||||
contents = { user = { email = "amartin@lrde.epita.fr"; }; };
|
||||
}
|
||||
{
|
||||
condition = "gitdir:~/work/prologin";
|
||||
contents = { user = { email = "antoine.martin@prologin.org"; }; };
|
||||
}
|
||||
{
|
||||
condition = "gitdir:~/work/epita";
|
||||
contents = { user = { email = "antoine4.martin@epita.fr"; }; };
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue