diff options
author | EuAndreh <eu@euandre.org> | 2023-02-17 17:16:28 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-02-17 17:16:28 -0300 |
commit | 516546eaf6f7075c3c9374de29a264ff633c8f72 (patch) | |
tree | 915d815720f3ec208c1d8e4b4b3c091837c26717 | |
parent | etc/nix/configuration.nix: Enable postfix service (diff) | |
download | dotfiles-516546eaf6f7075c3c9374de29a264ff633c8f72.tar.gz dotfiles-516546eaf6f7075c3c9374de29a264ff633c8f72.tar.xz |
bin/upgrade: Do some ugly ifs to decide what to upgrade
-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 |