From cea729933de548ffde15d0a6ef30a315fa5b3c35 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Fri, 30 May 2025 11:30:07 +0200 Subject: [PATCH] update scripts to local path, use eachother, and purge garbage causing issues right now --- rebuild-nix-system.sh | 9 ++++++++- update-nix-system.sh | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rebuild-nix-system.sh b/rebuild-nix-system.sh index c8a0f84..c6ee2ba 100755 --- a/rebuild-nix-system.sh +++ b/rebuild-nix-system.sh @@ -1,2 +1,9 @@ #!/bin/bash -sudo nixos-rebuild switch --flake /etc/nixos/#default + +# Rebuild the system +sudo nixos-rebuild switch --flake ./#default + +# Clean up old generations older than 90 days +sudo nix-collect-garbage --delete-older-than 90d + + diff --git a/update-nix-system.sh b/update-nix-system.sh index 6c7a529..8117b73 100755 --- a/update-nix-system.sh +++ b/update-nix-system.sh @@ -1,3 +1,7 @@ #!/bin/bash -sudo nix flake update /etc/nixos -sudo nixos-rebuild switch --flake /etc/nixos/#default + +# Update the system +sudo nix flake update ./ + +# Rebuild the system +./rebuild-nix-system.sh