relocate git config

This commit is contained in:
Zynh Ludwig 2024-02-28 20:43:07 -08:00
parent 9305e26252
commit 1244a55fc8
2 changed files with 42 additions and 36 deletions

View file

@ -1,6 +1,10 @@
{ config, pkgs, inputs, ... }:
{
imports = [
./home/modules/git.nix
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "ravenshade";
@ -71,42 +75,6 @@
'';
};
programs.git = {
enable = true;
userName = "Zynh Ludwig";
userEmail = "zynh0722@gmail.com";
aliases = {
co = "checkout";
ci = "commit";
st = "status";
br = "branch";
hist = "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short";
type = "cat-file -t";
dump = "cat-file -p";
graph = "log --graph --decorate --pretty=oneline --abbrev-commit";
};
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "nvim";
autocrlf = "input";
safecrlf = true;
};
credential = {
helper = [
"cache --timeout 7200"
"oauth"
];
"https://git.zynh.me" = {
oauthClientId = "13d5b95d-565d-4264-8961-c45cc38eaa8a";
oauthScopes = "read_repository write_repository";
oauthAuthURL = "/login/oauth/authorize";
oauthTokenURL = "/login/oauth/access_token";
};
};
};
};
# wayland.windowManager.hyprland = {
# enable = true;
# package = pkgs.hyprland;

38
home/modules/git.nix Normal file
View file

@ -0,0 +1,38 @@
{ ... }:
{
programs.git = {
enable = true;
userName = "Zynh Ludwig";
userEmail = "zynh0722@gmail.com";
aliases = {
co = "checkout";
ci = "commit";
st = "status";
br = "branch";
hist = "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short";
type = "cat-file -t";
dump = "cat-file -p";
graph = "log --graph --decorate --pretty=oneline --abbrev-commit";
};
extraConfig = {
init.defaultBranch = "main";
core = {
editor = "nvim";
autocrlf = "input";
safecrlf = true;
};
credential = {
helper = [
"cache --timeout 7200"
"oauth"
];
"https://git.zynh.me" = {
oauthClientId = "13d5b95d-565d-4264-8961-c45cc38eaa8a";
oauthScopes = "read_repository write_repository";
oauthAuthURL = "/login/oauth/authorize";
oauthTokenURL = "/login/oauth/access_token";
};
};
};
};
}