refactor(homeModules): move git config to module
This commit is contained in:
parent
95146e2cdf
commit
991a10ca18
4 changed files with 15 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
imports = [
|
||||
./file-browser/yazi.nix
|
||||
./editor/nvf.nix
|
||||
./utilities/git.nix
|
||||
];
|
||||
|
||||
options.cli = {
|
||||
|
|
33
modules/home/cli/utilities/git.nix
Normal file
33
modules/home/cli/utilities/git.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{lib,config,...}:
|
||||
{
|
||||
options.cli.git = {
|
||||
name = lib.pantheon.mkStrOption;
|
||||
email = lib.pantheon.mkStrOption;
|
||||
defaultBranch = lib.pantheon.mkStrOption;
|
||||
};
|
||||
|
||||
config = {
|
||||
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
|
||||
home.shellAliases = {
|
||||
gs = "git status";
|
||||
gc = "git commit";
|
||||
gcam = "git commit -am";
|
||||
gu = "git push";
|
||||
gy = "git pull";
|
||||
};
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = config.cli.git.name;
|
||||
userEmail = config.cli.git.email;
|
||||
signing.key = "~/.ssh/id_ed25519.pub";
|
||||
signing.signByDefault = true;
|
||||
extraConfig = {
|
||||
init.defaultBranch = config.cli.git.defaultBranch;
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = false;
|
||||
core.editor = "$EDITOR";
|
||||
gpg.format = "ssh";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue