From 516546eaf6f7075c3c9374de29a264ff633c8f72 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 17 Feb 2023 17:16:28 -0300 Subject: bin/upgrade: Do some ugly ifs to decide what to upgrade --- bin/upgrade | 19 +++++++++++++++---- 1 file 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 -- cgit v1.2.3