added some git configuration and a notification if git isnt setup

This commit is contained in:
Tomas Rivera
2026-03-01 17:43:30 +01:00
parent 43388e08c9
commit 31aab60790
4 changed files with 32 additions and 16 deletions
+4 -13
View File
@@ -3,17 +3,8 @@
{
programs.git = {
enable = true;
# user.email dont work #user.email = "137088692+Totorile1@users.noreply.github.com";
#user.name = "Totorile1";
# no declarative parameters for git as it would show in a public git repo more info than I would like. Just use the following commands
# git config --global user.name "YourName"
# git config --global user.email "YourEmail"
# git config --global init.defaultBranch main
# git config --global user.email "137088692+Totorile1@users.noreply.github.com"
#cd ~/nixos\
#git add .
#git commit -m "Update NixOS configuration"
#git push origin master
};
settings = {
init.defaultBranch = "main";
};
};
}
+1 -1
View File
@@ -197,7 +197,7 @@ in
"sleep 1 && custom-wallpaper"
"custom-mountkdrive"
"waybar"
"custom-gitnotify"
#########################
# login autostart
+24
View File
@@ -0,0 +1,24 @@
{ writeShellApplication, git, libnotify, ... }:
writeShellApplication {
name = "custom-gitnotify";
runtimeInputs = [
git
libnotify
];
text = ''
# Check if git is installed
if ! command -v git >/dev/null 2>&1; then
exit 0
fi
NAME=$(git config --global user.name)
EMAIL=$(git config --global user.email)
if [[ -z "$NAME" || -z "$EMAIL" ]]; then
notify-send \
"Git not configured" \
"Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/home-manager/hyprland.nix"
fi
'';
}