2022-08-25 12:21:35 -06:00
|
|
|
{ config, pkgs, isUnstable, ... }:
|
2023-01-26 07:57:15 -07:00
|
|
|
let
|
|
|
|
rewriteGitHub = if config.networking.hostName != "stan" then {
|
|
|
|
url = { "ssh://git@github.com/" = { insteadOf = "https://github.com/"; }; };
|
|
|
|
} else {
|
|
|
|
url = { };
|
|
|
|
};
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2023-01-26 07:57:15 -07:00
|
|
|
in {
|
2022-08-25 12:21:35 -06:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
lfs.enable = true;
|
2022-12-21 07:15:56 -07:00
|
|
|
config = if isUnstable then [
|
2022-12-20 19:35:36 -07:00
|
|
|
{ init = { defaultBranch = "main"; }; }
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{
|
|
|
|
user = {
|
|
|
|
name = "Aaron Bieber";
|
|
|
|
email = "aaron@bolddaemon.com";
|
|
|
|
signingKey = if isUnstable then
|
2023-02-02 08:18:09 -07:00
|
|
|
"key::sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIB1cBO17AFcS2NtIT+rIxR2Fhdu3HD4de4+IsFyKKuGQAAAACnNzaDpsZXNzZXI="
|
2022-12-20 19:35:36 -07:00
|
|
|
else
|
|
|
|
"35863350BFEAC101DB1A4AF01F81112D62A9ADCE";
|
|
|
|
};
|
|
|
|
}
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{ branch = { sort = "-committerdate"; }; }
|
|
|
|
{
|
|
|
|
alias = {
|
|
|
|
log = "log --color=never";
|
|
|
|
diff = "diff --color=always";
|
|
|
|
pr = ''"!f() { git fetch-pr upstream $1; git checkout pr/$1; }; f"'';
|
|
|
|
fetch-pr = ''
|
|
|
|
"!f() { git fetch $1 refs/pull/$2/head:refs/remotes/pr/$2; }; f"'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{ push = { default = "current"; }; }
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{ gpg = if isUnstable then { format = "ssh"; } else { }; }
|
|
|
|
{ commit = if isUnstable then { gpgsign = true; } else { }; }
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{
|
|
|
|
color = {
|
|
|
|
branch = false;
|
|
|
|
interactive = false;
|
|
|
|
log = false;
|
|
|
|
status = false;
|
|
|
|
ui = false;
|
|
|
|
};
|
|
|
|
}
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{ safe = { directory = "/home/qbit/src/nix-conf"; }; }
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{ transfer = { fsckobjects = true; }; }
|
|
|
|
{ fetch = { fsckobjects = true; }; }
|
|
|
|
{ github = { user = "qbit"; }; }
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2023-01-26 07:57:15 -07:00
|
|
|
{ inherit (rewriteGitHub) url; }
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{
|
|
|
|
sendmail = {
|
|
|
|
smtpserver = "mail.messagingengine.com";
|
|
|
|
smtpuser = "qbit@fastmail.com";
|
|
|
|
smtpauth = "PLAIN";
|
|
|
|
smtpencryption = "tls";
|
|
|
|
smtpserverport = 587;
|
|
|
|
cc = "aaron@bolddaemon.com";
|
|
|
|
confirm = "auto";
|
|
|
|
};
|
|
|
|
}
|
2022-08-25 12:21:35 -06:00
|
|
|
|
2022-12-20 19:35:36 -07:00
|
|
|
{ pull = { rebase = false; }; }
|
|
|
|
{ include = { path = "~/work/git/gitconfig"; }; }
|
2022-12-21 07:15:56 -07:00
|
|
|
] else {
|
|
|
|
init = { defaultBranch = "main"; };
|
|
|
|
|
|
|
|
user = {
|
|
|
|
name = "Aaron Bieber";
|
|
|
|
email = "aaron@bolddaemon.com";
|
|
|
|
signingKey = if isUnstable then
|
|
|
|
"key::sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHrYWbbgBkGcOntDqdMaWVZ9xn+dHM+Ap6s1HSAalL28AAAACHNzaDptYWlu"
|
|
|
|
else
|
|
|
|
"35863350BFEAC101DB1A4AF01F81112D62A9ADCE";
|
|
|
|
};
|
|
|
|
|
|
|
|
branch = { sort = "-committerdate"; };
|
|
|
|
|
|
|
|
alias = {
|
|
|
|
log = "log --color=never";
|
|
|
|
diff = "diff --color=always";
|
|
|
|
pr = ''"!f() { git fetch-pr upstream $1; git checkout pr/$1; }; f"'';
|
|
|
|
fetch-pr =
|
|
|
|
''"!f() { git fetch $1 refs/pull/$2/head:refs/remotes/pr/$2; }; f"'';
|
|
|
|
};
|
|
|
|
|
|
|
|
push = { default = "current"; };
|
|
|
|
|
|
|
|
gpg = if isUnstable then { format = "ssh"; } else { };
|
|
|
|
commit = if isUnstable then { gpgsign = true; } else { };
|
|
|
|
|
|
|
|
color = {
|
|
|
|
branch = false;
|
|
|
|
interactive = false;
|
|
|
|
log = false;
|
|
|
|
status = false;
|
|
|
|
ui = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
transfer = { fsckobjects = true; };
|
|
|
|
fetch = { fsckobjects = true; };
|
|
|
|
github = { user = "qbit"; };
|
|
|
|
|
|
|
|
url = {
|
|
|
|
"ssh://git@github.com/" = { insteadOf = "https://github.com/"; };
|
|
|
|
};
|
|
|
|
|
|
|
|
sendmail = {
|
|
|
|
smtpserver = "mail.messagingengine.com";
|
|
|
|
smtpuser = "qbit@fastmail.com";
|
|
|
|
smtpauth = "PLAIN";
|
|
|
|
smtpencryption = "tls";
|
|
|
|
smtpserverport = 587;
|
|
|
|
cc = "aaron@bolddaemon.com";
|
|
|
|
confirm = "auto";
|
|
|
|
};
|
|
|
|
|
|
|
|
pull = { rebase = false; };
|
|
|
|
include = { path = "~/work/git/gitconfig"; };
|
|
|
|
};
|
2022-08-25 12:21:35 -06:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|