diff options
author | Franz Geffke <franz@pantherx.org> | 2023-11-06 20:08:14 +0000 |
---|---|---|
committer | Franz Geffke <franz@pantherx.org> | 2023-11-06 20:08:14 +0000 |
commit | 47b4c9c854915df93893dbaa993accfacf9027fe (patch) | |
tree | 4f9b1742d63fcfbc94cc6b8d84f76c4d00c3a0b7 /px/services/enterprise.scm | |
parent | 0b426d7b7ed8e176bf464ef9e0683f74a6c9d20f (diff) |
rewrite: apply guix-reference formatting; cleanup some module imports
Diffstat (limited to 'px/services/enterprise.scm')
-rw-r--r-- | px/services/enterprise.scm | 98 |
1 files changed, 53 insertions, 45 deletions
diff --git a/px/services/enterprise.scm b/px/services/enterprise.scm index 998092b..b01994a 100644 --- a/px/services/enterprise.scm +++ b/px/services/enterprise.scm @@ -14,28 +14,33 @@ ;;; (define-record-type* <px-channel-migration-configuration> - px-channel-migration-configuration make-px-channel-migration-configuration + px-channel-migration-configuration + make-px-channel-migration-configuration px-channel-migration-configuration? - (profile px-channel-migration-configuration-profile ;; path to profile we want to migrate (root) - (default "/root/.config/guix/current")) - (config px-channel-migration-configuration-config ;; path to system configuration file - (default "/etc/system.scm")) - (channels px-channel-migration-configuration-channels ;; path to channels file + (profile px-channel-migration-configuration-profile ;path to profile we want to migrate (root) + (default "/root/.config/guix/current")) + (config px-channel-migration-configuration-config ;path to system configuration file + (default "/etc/system.scm")) + (channels px-channel-migration-configuration-channels ;path to channels file (default "/etc/guix/channels.scm")) - (branch px-channel-migration-configuration-branch) ;; target branch that we want to migrate to - (timeout px-channel-migration-configuration-timeout ;; timeout before start the migration - (default 60))) - + (branch px-channel-migration-configuration-branch) ;target branch that we want to migrate to + (timeout px-channel-migration-configuration-timeout ;timeout before start the migration + (default 60))) (define (px-channel-migration->script config) (match config - (($ <px-channel-migration-configuration> profile config channels branch timeout) - (computed-file - "px-channel-migration.sh" - #~(begin - (call-with-output-file #$output - (lambda (port) - (format port "# AUTO GENERATED BY: px-channel-migration-service + (($ <px-channel-migration-configuration> + profile + config + channels + branch + timeout) + (computed-file "px-channel-migration.sh" + #~(begin + (call-with-output-file #$output + (lambda (port) + (format port + "# AUTO GENERATED BY: px-channel-migration-service GUIX_PROFILE=~a SYSTEM_CONFIG=~a SYSTEM_CHANNELS=~a @@ -78,8 +83,7 @@ fi echo \">>> Start system reconfigure\" function perform_reconfigure { - guix time-machine --disable-authentication --channels=$SYSTEM_CHANNELS \ - -- system reconfigure --allow-downgrades $SYSTEM_CONFIG + guix time-machine --disable-authentication --channels=$SYSTEM_CHANNELS -- system reconfigure --allow-downgrades $SYSTEM_CONFIG } perform_reconfigure while [ $? -ne 0 ]; do @@ -91,36 +95,40 @@ done guix describe echo $(date +'%s') > $UPGRADE_FILE echo \">>> Device channels migrated successfully.\" -" #$profile #$config #$channels #$branch #$timeout #$(file-append recutils "/bin/recsel"))))))))) - +" + #$profile + #$config + #$channels + #$branch + #$timeout + #$(file-append recutils "/bin/recsel"))))))))) (define (px-channel-migration-shepherd-service config) (match config (($ <px-channel-migration-configuration> ...) (let ((script (px-channel-migration->script config))) - (list (shepherd-service - (provision '(px-channel-migration)) - (documentation "Migrate device channels to new references") - (requirement '(networking user-processes)) - (one-shot? #t) - (start #~(make-forkexec-constructor - (list (string-append #$bash "/bin/bash") - #$script) - #:environment-variables - (cons* - "HOME=/root" - "XDG_DATA_HOME=/root/.local/share" - "XDG_CONFIG_HOME=/root/.config" - "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" - "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" - (default-environment-variables)) - #:log-file "/var/log/px-channel-migration.log")) - (stop #~(make-kill-destructor)))))))) - + (list (shepherd-service (provision '(px-channel-migration)) + (documentation + "Migrate device channels to new references") + (requirement '(networking user-processes)) + (one-shot? #t) + (start #~(make-forkexec-constructor (list (string-append #$bash + "/bin/bash") + #$script) + #:environment-variables (cons* + "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)) + #:log-file + "/var/log/px-channel-migration.log")) + (stop #~(make-kill-destructor)))))))) (define px-channel-migration-service-type - (service-type - (name 'px-channel-migration) - (description "Migrate device channels to new references") - (extensions (list (service-extension shepherd-root-service-type - px-channel-migration-shepherd-service))))) + (service-type (name 'px-channel-migration) + (description "Migrate device channels to new references") + (extensions (list (service-extension + shepherd-root-service-type + px-channel-migration-shepherd-service))))) |