diff options
| author | EuAndreh <eu@euandre.org> | 2023-02-26 17:51:47 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2023-02-26 17:51:47 -0300 |
| commit | 53a69e0611e858e99ecefc3224c18a09d911d514 (patch) | |
| tree | 025edf1a5478a5b9976dd787eb2813da37d06a9b /bin/upgrade | |
| parent | bin/upgrade: Fix call to timeout (diff) | |
| download | dotfiles-53a69e0611e858e99ecefc3224c18a09d911d514.tar.gz dotfiles-53a69e0611e858e99ecefc3224c18a09d911d514.tar.xz | |
git mv bin/upgrade bin/reconfigure
Diffstat (limited to 'bin/upgrade')
| -rwxr-xr-x | bin/upgrade | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/bin/upgrade b/bin/upgrade deleted file mode 100755 index 298ac31..0000000 --- a/bin/upgrade +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - upgrade - upgrade -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - - Upgrades the system: - - reconfigure the Guix "home" environment; - - Guix "system" if it exists; - - NixOS if it exists. - - - Examples: - - Just use it: - - $ upgrade - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -HOSTNAME="$(hostname)" - -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 - -TWO_HOURS='7200' - -timeout "$TWO_HOURS" \ - 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 |
