Change upgrade script to always continue even without package updates
This commit is contained in:
parent
b0ed6005f1
commit
99a2022185
12
flake.lock
12
flake.lock
|
@ -117,11 +117,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713294767,
|
"lastModified": 1713391096,
|
||||||
"narHash": "sha256-LmaabaQZdx52MPGKPRt9Opoc9Gd9RbwvCdysUUYQoXI=",
|
"narHash": "sha256-5xkzsy+ILgQlmvDDipL5xqAehnjWBenAQXV4/NLg2dE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "fa8c16e2452bf092ac76f09ee1fb1e9f7d0796e7",
|
"rev": "f46814ec7cbef9c2aef18ca1cbe89f2bb1e8c394",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -174,11 +174,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713377320,
|
"lastModified": 1713441075,
|
||||||
"narHash": "sha256-OrBm62B+X9jylr6cPgKc+5OSgF2PRW9IY0ARCOtURMY=",
|
"narHash": "sha256-3GGeFsEO8ivD+TcDEqe4s/d0VLvMYGNDGtx0ZnBxkUs=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "f2d364de6589f7a029624983593eafc3c4dac726",
|
"rev": "6f976e53752e5b9ab08f9a3b1b0b9c67815c9754",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -41,11 +41,13 @@ echo "Using installation mode: $OPERATION"
|
||||||
cd ~/Development/nix-configuration
|
cd ~/Development/nix-configuration
|
||||||
nix flake update
|
nix flake update
|
||||||
nixos-rebuild build --flake .
|
nixos-rebuild build --flake .
|
||||||
UPDATES=$(nix store diff-closures /run/current-system ./result | awk '/[0-9] →|→ [0-9]/ && !/nixos/' || echo)
|
PACKAGE_UPDATES=$(nix store diff-closures /run/current-system ./result | awk '/[0-9] →|→ [0-9]/ && !/nixos/' || echo)
|
||||||
|
|
||||||
|
if [ "$PACKAGE_UPDATES" ]; then
|
||||||
|
echo "Packages to update: "
|
||||||
|
echo $PACKAGE_UPDATES
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$UPDATES" ]; then
|
|
||||||
echo "NixOS updates to apply: "
|
|
||||||
echo $UPDATES
|
|
||||||
if [ $AUTOACCEPT == false ]; then
|
if [ $AUTOACCEPT == false ]; then
|
||||||
read -p "Continue with upgrade (y/n) ? " choice
|
read -p "Continue with upgrade (y/n) ? " choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
|
@ -54,10 +56,8 @@ if [ "$UPDATES" ]; then
|
||||||
* ) echo "Invalid option. Upgrade cancelled." && exit;;
|
* ) echo "Invalid option. Upgrade cancelled." && exit;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo nixos-rebuild $OPERATION --flake .
|
sudo nixos-rebuild $OPERATION --flake .
|
||||||
else
|
|
||||||
echo "No NixOS updates found."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Updating Flatpaks:"
|
echo "Updating Flatpaks:"
|
||||||
flatpak update
|
flatpak update
|
||||||
|
|
Loading…
Reference in a new issue