Files
config/users/pbsds/home/profiles/headless/git.nix
T
2025-11-29 05:20:22 +01:00

41 lines
871 B
Nix

{ pkgs, ... }:
{
imports = [
../minimal/git.nix
];
# programs.gh.enable = true; # adds read-only config to .config
# programs.git.gitui.enable = true;
programs.git.lfs.enable = true;
home.packages = with pkgs; [
git-wait
colordiff
diffnav
gh
tea
#hub
(pkgs.symlinkJoin {
inherit (pkgs.hub) name meta;
paths = [ pkgs.hub ];
# TODO: this could be a pre-command added with makeWrapper
postBuild = ''
rm $out/bin/hub
cat <<"EOF" >$out/bin/hub
#!${pkgs.runtimeShell}
# https://hub.github.com/hub.1.html#github-oauth-authentication
if [[ ! -d ~/.config/hub ]]; then
export GITHUB_TOKEN=$(${pkgs.gh}/bin/gh auth token 2>/dev/null)
fi
exec -a "$0" ${pkgs.hub}/bin/hub "$@"
EOF
chmod +x $out/bin/hub
'';
})
];
}