customize git

This commit is contained in:
2023-08-21 15:26:18 +08:00
parent 26a41318fa
commit 0e69a9d0c4
2 changed files with 43 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ inputs:
# downloader
wget aria2 curl
# file manager
tree git exa trash-cli lsd broot file xdg-ninja mlocate
tree exa trash-cli lsd broot file xdg-ninja mlocate
# compress
pigz rar upx unzip inputs.topInputs.nixpkgs-stable.legacyPackages.x86_64-linux.zip lzip p7zip
# file system management
@@ -85,6 +85,17 @@ inputs:
adb.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
autojump.enable = true;
git =
{
enable = true;
package = inputs.pkgs.gitFull;
lfs.enable = true;
config =
{
init.defaultBranch = "main";
core = { quotepath = false; editor = "vim"; };
};
};
};
services =
{

View File

@@ -48,7 +48,7 @@ inputs:
useUserPackages = true;
users =
let
normal = { pkgs, ...}:
normal = { gui ? false }: { pkgs, ...}:
{
home.stateVersion = "22.11";
programs.zsh =
@@ -104,16 +104,6 @@ inputs:
sha256 = "sha256-oWjWnhiimlGBMaZlZB+OM47jd9hporKlPNwCx6524Rk=";
};
}
# {
# name = "zsh-exa";
# src = pkgs.fetchFromGitHub
# {
# owner = "ptavares";
# repo = "zsh-exa";
# rev = "0.2.3";
# sha256 = "0vn3iv9d3c1a4rigq2xm52x8zjaxlza1pd90bw9mbbkl9iq8766r";
# };
# }
];
history =
{
@@ -124,11 +114,39 @@ inputs:
};
};
programs.direnv = { enable = true; nix-direnv.enable = true; };
programs.git =
{
enable = true;
lfs.enable = true;
userEmail = "chn@chn.moe";
userName = "chn";
extraConfig =
{
core.editor = if gui then "code --wait" else "vim";
advice.detachedHead = false;
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
};
package = pkgs.gitFull;
delta =
{
enable = true;
options =
{
side-by-side = true;
navigate = true;
syntax-theme = "GitHub";
light = true;
zero-style = "syntax white";
line-numbers-zero-style = "#ffffff";
};
};
};
};
in
{
root = normal;
chn = normal;
root = normal { gui = false; };
chn = normal { gui = inputs.config.nixos.system.gui.enable; };
};
};
}