aboutsummaryrefslogtreecommitdiffstats
path: root/modules/system/nix-update/nix-update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/nix-update/nix-update.sh')
-rw-r--r--modules/system/nix-update/nix-update.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/system/nix-update/nix-update.sh b/modules/system/nix-update/nix-update.sh
index 943a1d8..bacfc20 100644
--- a/modules/system/nix-update/nix-update.sh
+++ b/modules/system/nix-update/nix-update.sh
@@ -69,6 +69,8 @@ update_home_manager() {
info "Staging users/arpit/private.nix..."
git add users/arpit/private.nix -f
+ trap 'git rm --cached users/arpit/private.nix >/dev/null 2>&1 || true' EXIT INT TERM HUP
+
if [[ "$ONLY_SWITCH" == false ]]; then
info "Running nix flake update..."
nix flake update
@@ -82,6 +84,8 @@ update_home_manager() {
info "Unstaging users/arpit/private.nix..."
git rm --cached users/arpit/private.nix
+ trap - EXIT INT TERM HUP
+
info "home-manager update complete"
}
@@ -93,6 +97,8 @@ update_nixos() {
info "Staging hardware-configuration.nix..."
git add hardware-configuration.nix -f
+ trap 'git rm --cached hardware-configuration.nix >/dev/null 2>&1 || true' EXIT INT TERM HUP
+
if [[ "$ONLY_SWITCH" == false ]]; then
info "Running nix flake update..."
nix flake update
@@ -106,6 +112,8 @@ update_nixos() {
info "Unstaging hardware-configuration.nix..."
git rm --cached hardware-configuration.nix
+ trap - EXIT INT TERM HUP
+
info "NixOS update complete"
}
@@ -122,4 +130,4 @@ case "$TARGET" in
update_nixos
update_home_manager
;;
-esac \ No newline at end of file
+esac