aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-02-17 17:16:28 -0300
committerEuAndreh <eu@euandre.org>2023-02-17 17:16:28 -0300
commit516546eaf6f7075c3c9374de29a264ff633c8f72 (patch)
tree915d815720f3ec208c1d8e4b4b3c091837c26717
parentetc/nix/configuration.nix: Enable postfix service (diff)
downloaddotfiles-516546eaf6f7075c3c9374de29a264ff633c8f72.tar.gz
dotfiles-516546eaf6f7075c3c9374de29a264ff633c8f72.tar.xz
bin/upgrade: Do some ugly ifs to decide what to upgrade
-rwxr-xr-xbin/upgrade19
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