Files
nixos/modules/packages/git.nix

23 lines
763 B
Nix

inputs:
{
options.nixos.packages.git = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) git; in inputs.lib.mkIf (git != null)
{
programs.git =
{
enable = true;
package = inputs.pkgs.gitFull;
lfs = { enable = true; enablePureSSHTransfer = true; };
config =
{
init.defaultBranch = "main";
core.quotepath = false;
lfs.ssh.automultiplex = false; # 避免 lfs 一直要求触摸 yubikey
receive.denyCurrentBranch = "warn"; # 允许 push 到非 bare 的仓库
merge.ours.driver = true; # 允许 .gitattributes 中设置的 merge=ours 生效
};
};
};
}