This commit is contained in:
Bryan Ramos 2026-04-15 20:58:07 -04:00
commit 864c69fe61
147 changed files with 11233 additions and 0 deletions

View file

@ -0,0 +1,32 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.modules.user.git;
in
{ options.modules.user.git = { enable = mkEnableOption "user.git"; };
config = mkIf cfg.enable {
programs = {
git = {
enable = true;
};
gh = {
enable = true;
settings.git_protocol = "ssh";
};
};
home = {
packages = with pkgs; [
git-crypt
];
file.".config/git" = {
source = ./git;
recursive = true;
};
};
programs.bash.initExtra = import ./scripts/cdg.nix;
};
}

View file

@ -0,0 +1,9 @@
# Git Config
My global git configuration.
## Install
```bash
git clone git@github.com:itme-brain/git.git ~/.config/git
```

View file

@ -0,0 +1,28 @@
[init]
defaultBranch = master
# Use vimdiff for diffs and merge conflicts
[diff]
tool = vimdiff
[merge]
tool = vimdiff
[mergetool]
keepBackup = false
[mergetool "vimdiff"]
trustExitCode = true
[user]
name = Bryan Ramos
email = bryan@ramos.codes
signingKey = F1F3466458452B2DF351F1E864D12BA95ACE1F2D
# Auto-set upstream on first push
[push]
autoSetupRemote = true
# Enable per-project with: git config --local commit.gpgSign true
[commit]
gpgSign = false

View file

@ -0,0 +1,14 @@
# JavaScript / Node
node_modules
# Nix
.direnv
result
# Haskell
dist-newstyle
# Nuxt
.nuxt/
.output/
dist

View file

@ -0,0 +1,24 @@
''
function cdg() {
if [[ $1 == "--help" ]]; then
echo "A simple utility for navigating to the root of a git repo"
return 0
fi
if [[ -n "$1" ]]; then
echo "Invalid command: $1. Try 'cdg --help'."
return 1
fi
local root_dir
root_dir=$(git rev-parse --show-toplevel 2>/dev/null)
local git_status=$?
if [ $git_status -ne 0 ]; then
echo "Error: Not a git repo."
return 1
fi
cd "$root_dir"
}
''