diff options
-rwxr-xr-x | bin/upgrade | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/bin/upgrade b/bin/upgrade index 62868b0..51c30c2 100755 --- a/bin/upgrade +++ b/bin/upgrade @@ -17,7 +17,9 @@ help() { Upgrades the system: - - reconfigure the Guix "home" environment and "system". + - reconfigure the Guix "home" environment; + - Guix "system" if it exists; + - NixOS if it exists. Examples: @@ -60,7 +62,16 @@ done shift $((OPTIND - 1)) -pass show velhinho/andreh | - head -n1 | - sudo -ES guix system -v3 reconfigure /run/current-system/configuration.scm +if [ -e /run/current-system/configuration.scm ]; then + pass show "$HOSTNAME"/andreh | + head -n1 | + sudo -ES guix system -v3 reconfigure /run/current-system/configuration.scm +fi + guix home -v3 reconfigure ~/.guix-home/configuration.scm + +if [ -e /etc/nixos/configuration.nix ]; then + pass show "$HOSTNAME"/andreh | + head -n1 | + sudo -S nixos-rebuild switch --upgrade +fi |