mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-27 19:27:05 +02:00
feat: add distributed-builds & many hosts
feat: remove nur & devenv feat: adjust the structure to make it suitable for servers feat: add iso/proxmox generators and add docs about it feat: update ryan's openssh keys & add hashedPassword feat: add proxmox's nodes into ssh_config, with alias
This commit is contained in:
77
home/base/server/git.nix
Normal file
77
home/base/server/git.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
# `programs.git` will generate the config file: ~/.config/git/config
|
||||
# to make git use this config file, `~/.gitconfig` should not exist!
|
||||
#
|
||||
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
||||
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
|
||||
rm -f ~/.gitconfig
|
||||
'';
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
userName = "Ryan Yin";
|
||||
userEmail = "xiaoyin_c@qq.com";
|
||||
|
||||
includes = [
|
||||
{
|
||||
# use diffrent email & name for work
|
||||
path = "~/work/.gitconfig";
|
||||
condition = "gitdir:~/work/";
|
||||
}
|
||||
];
|
||||
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = true;
|
||||
|
||||
# replace https with ssh
|
||||
url = {
|
||||
"ssh://git@github.com/" = {
|
||||
insteadOf = "https://github.com/";
|
||||
};
|
||||
"ssh://git@gitlab.com/" = {
|
||||
insteadOf = "https://gitlab.com/";
|
||||
};
|
||||
"ssh://git@bitbucket.com/" = {
|
||||
insteadOf = "https://bitbucket.com/";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# signing = {
|
||||
# key = "xxx";
|
||||
# signByDefault = true;
|
||||
# };
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
features = "side-by-side";
|
||||
};
|
||||
};
|
||||
|
||||
aliases = {
|
||||
# common aliases
|
||||
br = "branch";
|
||||
co = "checkout";
|
||||
st = "status";
|
||||
ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate";
|
||||
ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat";
|
||||
cm = "commit -m";
|
||||
ca = "commit -am";
|
||||
dc = "diff --cached";
|
||||
amend = "commit --amend -m";
|
||||
|
||||
# aliases for submodule
|
||||
update = "submodule update --init --recursive";
|
||||
foreach = "submodule foreach";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user