This commit is contained in:
Bryan Ramos 2026-03-15 11:08:33 -04:00
commit 072951659a
114 changed files with 6922 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;
};
}

1
user/modules/git/git Submodule

@ -0,0 +1 @@
Subproject commit d394ee0594e8b1162f05547c3f7da817b6fcb62a

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"
}
''