git is a proper module now

main
Zynh Ludwig 2024-05-29 21:59:06 -07:00
parent 1e7079e54c
commit 6543588596
3 changed files with 44 additions and 35 deletions

View File

@ -3,7 +3,6 @@
{ {
imports = [ imports = [
./home/modules ./home/modules
./home/modules/git.nix
]; ];
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should

View File

@ -4,7 +4,9 @@
./neovim.nix ./neovim.nix
./alacritty.nix ./alacritty.nix
./fish.nix ./fish.nix
./git.nix
]; ];
snowhawk.fish.enable = lib.mkDefault true; snowhawk.fish.enable = lib.mkDefault true;
snowhawk.git.enable = lib.mkDefault true;
} }

View File

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