diff options
author | EuAndreh <eu@euandre.org> | 2023-03-12 09:27:09 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-12 09:27:14 -0300 |
commit | c7296f70bc3c95053fb4078b61a052c51dda8762 (patch) | |
tree | a05e88e2648fea54dd258338a5bff654b6bba98c | |
parent | etc/guix/home.scm: Inline definition of clipmenu-latest from org-euandre channel (diff) | |
download | dotfiles-c7296f70bc3c95053fb4078b61a052c51dda8762.tar.gz dotfiles-c7296f70bc3c95053fb4078b61a052c51dda8762.tar.xz |
bin/reconfigure: Add -U option to call update(1)
Adapt the cronjob to use it also.
-rwxr-xr-x | bin/reconfigure | 18 | ||||
-rw-r--r-- | etc/guix/home.scm | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/bin/reconfigure b/bin/reconfigure index af94f48..72eb0c7 100755 --- a/bin/reconfigure +++ b/bin/reconfigure @@ -4,7 +4,7 @@ set -eu usage() { cat <<-'EOF' Usage: - reconfigure + reconfigure [-U] reconfigure -h EOF } @@ -13,6 +13,7 @@ help() { cat <<-'EOF' Options: + -U run update(1) before acting -h, --help show this message @@ -27,6 +28,11 @@ help() { Just use it: $ reconfigure + + + Update before reconfiguring: + + $ reconfigure -U EOF } @@ -46,8 +52,12 @@ for flag in "$@"; do esac done -while getopts 'h' flag; do +UPDATE=false +while getopts 'Uh' flag; do case "$flag" in + U) + UPDATE=true + ;; h) usage help @@ -68,6 +78,10 @@ if [ "$(id -un)" = 'root' ]; then exit 2 fi +if [ "$UPDATE" = true ]; then + update +fi + HOSTNAME="$(hostname)" diff --git a/etc/guix/home.scm b/etc/guix/home.scm index 24e8616..6c7812b 100644 --- a/etc/guix/home.scm +++ b/etc/guix/home.scm @@ -289,7 +289,7 @@ left it off the last time it was used.") (define cronjobs (list #~(job "0 0 * * *" "cronjob check") - #~(job "30 4 * * *" "cronjob x update AND reconfigure") + #~(job "30 4 * * *" "cronjob reconfigure -U") #~(job "30 1 * * *" "cronjob backup -q cron"))) (define (home-service name package bin) |