[+] Create nix-git-update command

This commit is contained in:
Hykilpikonna
2021-08-24 15:16:00 -04:00
committed by GitHub
parent ae97609c00
commit 9035b8dea1
+19
View File
@@ -1,3 +1,22 @@
alias rebuild="nixos-rebuild switch"
alias gc="nix-collect-garbage -d"
alias rebuild-gc="rebuild; gc"
# Update git
nix-git-update() {
# Make sure there aren't any other changes
if git diff-index --quiet HEAD --; then
# No changes
pushd /etc/nixos
update-nix-fetchgit *.nix
rebuild-gc
git add *.nix
git commit -m "[U] Update fetchgit refs"
git push
popd
else
# Changes
echo "Error: There are uncommitted changes"
git status
fi
}