From 0fa39523f702719f1aa8a9db95748293615e5136 Mon Sep 17 00:00:00 2001 From: Origami404 Date: Fri, 23 Jan 2026 10:51:41 +0800 Subject: [PATCH] [module/git] init --- home/hosts/hypnos.nix | 1 + home/modules/git.nix | 6 ++++ home/modules/shell.nix | 2 +- home/standalone/.gitconfig | 59 ++++++++++++++++++++++++++++++++++++++ home/standalone/.gitignore | 5 ++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 home/modules/git.nix create mode 100644 home/standalone/.gitconfig create mode 100644 home/standalone/.gitignore diff --git a/home/hosts/hypnos.nix b/home/hosts/hypnos.nix index b296489..391ef62 100644 --- a/home/hosts/hypnos.nix +++ b/home/hosts/hypnos.nix @@ -16,6 +16,7 @@ ../modules/llm.nix ../modules/ssh.nix ../modules/atuin.nix + ../modules/git.nix ]; programs.zsh.shellAliases = { diff --git a/home/modules/git.nix b/home/modules/git.nix new file mode 100644 index 0000000..a31f882 --- /dev/null +++ b/home/modules/git.nix @@ -0,0 +1,6 @@ +{ lib, ... }: +{ + programs.git.enable = true; + home.file = + (lib.origami404.standaloneToHome ".gitconfig") // (lib.origami404.standaloneToHome ".gitignore"); +} diff --git a/home/modules/shell.nix b/home/modules/shell.nix index f7da571..ae69c21 100644 --- a/home/modules/shell.nix +++ b/home/modules/shell.nix @@ -58,7 +58,7 @@ "du" = "dust"; "df" = "duf"; "cloc" = "scc"; - "cat" = "bat"; + # "cat" = "bat"; "x" = "atool -x"; "cl" = "clear"; }; diff --git a/home/standalone/.gitconfig b/home/standalone/.gitconfig new file mode 100644 index 0000000..f78a4f3 --- /dev/null +++ b/home/standalone/.gitconfig @@ -0,0 +1,59 @@ +# User setting +[user] + name = Origami404 + email = Origami404@foxmail.com + + +# Signing +[commit] + gpgsign = false + + +# Misc +[init] + defaultBranch = main +[core] + autocrlf = input + excludesfile = ~/.gitignore + + +# CLI Adjustment +[column] + ui = auto +[branch] + sort = -committerdate +[tag] + sort = version:refname +[help] + autocorrect = prompt + + +# Push and pull +[push] + default = simple + autoSetupRemote = true + followTags = true +[pull] + rebase = true +[fetch] + prune = true + pruneTags = true + all = true + + +# Diff and merge +[diff] + algorithm = histogram + colorMoved = plain + mnemonicPrefix = true + renames = true +[rebase] + autoSquash = true + autoStash = true + updateRefs = true +[rerere] + enabled = true + autoupdate = true + + +# Ref https://blog.gitbutler.com/how-git-core-devs-configure-git/ diff --git a/home/standalone/.gitignore b/home/standalone/.gitignore new file mode 100644 index 0000000..4dc724b --- /dev/null +++ b/home/standalone/.gitignore @@ -0,0 +1,5 @@ +.vscode/ +.local/ +.DS_Store +Thumbs.db +*~