Skip to content

Commit

Permalink
feat(home): add git
Browse files Browse the repository at this point in the history
  • Loading branch information
yunfachi committed Dec 15, 2023
1 parent 80f1540 commit 2f13f13
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions home/programs/git.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
config,
lib,
userfullname,
useremail,
...
}: let
cfg = config.yunfachi.git;
in {
config = lib.mkIf cfg.enable {
programs.git = {
enable = true;
lfs.enable = true;

userName = userfullname;
userEmail = useremail;

extraConfig = {
init.defaultBranch = "master";
push.autoSetupRemote = true;
pull.rebase = true;

# replace https with ssh
url = {
"ssh://[email protected]/" = {
insteadOf = "https://github.com/";
};
"ssh://[email protected]/" = {
insteadOf = "https://gitlab.com/";
};
"ssh://[email protected]/" = {
insteadOf = "https://bitbucket.com/";
};
};
};
};
};
}
1 change: 1 addition & 0 deletions options/home/programs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ in {
options.yunfachi = {
discord.enable = lib.mkEnableOption "discord" // {default = type == "desktop";};
firefox.enable = lib.mkEnableOption "firefox" // {default = type == "desktop";};
git.enable = lib.mkEnableOption "git" // {default = true;};
kitty.enable = lib.mkEnableOption "kitty" // {default = type == "desktop";};
shikimori.enable = lib.mkEnableOption "shikimori" // {default = type == "desktop";};
};
Expand Down

0 comments on commit 2f13f13

Please sign in to comment.