diff options
author | EuAndreh <eu@euandre.org> | 2022-10-23 22:59:07 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-10-23 22:59:07 -0300 |
commit | 401705e9af8be15835c0b43d4f16ce36f1b1b9b5 (patch) | |
tree | 2df4eb831ba690cfc62fe58229f6633492161a64 | |
parent | bin/gc: remove "current-guix" profile too (diff) | |
download | dotfiles-401705e9af8be15835c0b43d4f16ce36f1b1b9b5.tar.gz dotfiles-401705e9af8be15835c0b43d4f16ce36f1b1b9b5.tar.xz |
bin/upgrade: Add equivalent of `update` script
-rwxr-xr-x | bin/upgrade | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/bin/upgrade b/bin/upgrade new file mode 100755 index 0000000..12f319c --- /dev/null +++ b/bin/upgrade @@ -0,0 +1,66 @@ +#!/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 and "system". + + + 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)) + + +pass show velhinho/0-andreh-password | + head -n1 | + sudo -iS guix system -v3 reconfigure /etc/guix/configuration.scm +guix home -v3 reconfigure ~/.usr/etc/guix/home.scm |