aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2021-10-12Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe
2021-10-12gnu: Add python-geopandas....Felix Gruber
2021-10-12gnu: Add python-fiona....Felix Gruber
2021-10-12gnu: Add python-cligj....Felix Gruber
2021-10-12gnu: Add python-pyproj....Felix Gruber
2021-10-12gnu: proj: Update to 7.2.1....Felix Gruber
2021-10-12gnu: clipper: Disable non-deterministic test....Felix Gruber
2021-10-12gnu: synapse: Update to 1.44.0....Felix Gruber
2021-10-12gnu: python-eliot: Update to 1.13.0....Felix Gruber
2021-10-12gnu: python-distributed: Update to 2021.09.1....Felix Gruber
2021-10-12gnu: python-dask: Update to 2021.9.1....Felix Gruber
2021-10-12gnu: python-pandas: Update to 1.3.3....Felix Gruber
2021-10-12gnu: komikku: Update to 0.35.0....Liliana Marie Prikler
2021-10-12gnu: kdenlive: Update to 21.08.2....Vinicius Monego
2021-10-12gnu: srain: Update to 1.3.0....Vinicius Monego
2021-10-12gnu: shotcut: Update to 21.09.20....Vinicius Monego
2021-10-12gnu: markets: Update to 0.5.3....Vinicius Monego
2021-10-12gnu: krita: Update to 4.4.8....Z572
2021-10-12gnu: tectonic: Update to 0.8.0....Nicolas Goaziou
2021-10-12gnu: Add rust-tectonic-bridge-core-0.3....Nicolas Goaziou
2021-10-12gnu: Add rust-tectonic-bundles-0.2....Nicolas Goaziou
2021-10-12gnu: Add rust-tectonic-geturl-0.3....Nicolas Goaziou
2021-10-12gnu: img2pdf: Update to 0.4.2....Nicolas Goaziou
2021-10-12gnu: emacs-project: Update to 0.8.1....Nicolas Goaziou
2021-10-12gnu: emacs-direnv: Update to 2.2.0....Nicolas Goaziou
2021-10-12gnu: emacs-corfu: Update to 0.13....Nicolas Goaziou
2021-10-12gnu: Add julia-structarrays....Efraim Flashner
2021-10-12gnu: Add julia-configurations....Efraim Flashner
2021-10-12gnu: Add julia-expronicon....Efraim Flashner
2021-10-12gnu: Add julia-bson....Efraim Flashner
2021-10-12gnu: Add julia-dataframes....Efraim Flashner
2021-10-12gnu: Add julia-pyplot....Efraim Flashner
2021-10-12gnu: Add julia-latexstrings....Efraim Flashner
2021-10-12gnu: gnuastro: Update to 0.16....Efraim Flashner
2021-10-11gnu: ganeti: Adjust to GHC 8.10 / Stackage 18.10....Marius Bakke
2021-10-11gnu: uBlock Origin: Update to 1.38.4....Marius Bakke
2021-10-11gnu: ungoogled-chromium: Update to 94.0.4606.81-1....Marius Bakke
2021-10-11doc: Fix typo....Marius Bakke
2021-10-11gnu: ganeti: Update to 3.0.1....Marius Bakke
2021-10-11services: ganeti: Don't start the metadata daemon automatically....Marius Bakke
2021-10-11gnu: drbd-utils: Update to 9.19.0....Marius Bakke
2021-10-11gnu: emacs-marginalia: Update to 0.9....Nicolas Goaziou
2021-10-11gnu: emacs-corfu: Update to 0.12....Nicolas Goaziou
2021-10-11gnu: emacs-consult: Update to 0.12....Nicolas Goaziou
2021-10-11gnu: r-shiny: Fix build....Guillaume Le Vaillant
2021-10-11gnu: owncloud-client: Fix sysconfdir path...Daniel Meißner
2021-10-11gnu: owncloud-client: Update to 2.9.0.5150....Liliana Marie Prikler
2021-10-11gnu: Add platform support....Mathieu Othacehe
2021-10-11doc: guix: Fix typo....Oleg Pykhalov
2021-10-11gnu: linux-libre 4.4: Update to 4.4.288....Leo Famulari
ls. (if target findutils (canonical-package findutils)))) "The GNU@tie{}Findutils package from which the @command{updatedb} command is taken.") (schedule (string-or-gexp %default-file-database-update-schedule) "String or G-exp denoting an mcron schedule for the periodic @command{updatedb} job (@pxref{Guile Syntax,,, mcron, GNU@tie{}mcron}).") (excluded-directories (string-list %default-file-database-excluded-directories) "List of regular expressions of directories to ignore when building the file database. By default, this includes @file{/tmp} and @file{/gnu/store}; the latter should instead be indexed by @command{guix locate} (@pxref{Invoking guix locate}). This list is passed to the @option{--prunepaths} option of @command{updatedb} (@pxref{Invoking updatedb,,, find, GNU@tie{}Findutils}).")) (define (file-database-mcron-jobs configuration) (match-record configuration <file-database-configuration> (package schedule excluded-directories) (let ((updatedb (program-file "updatedb" #~(begin ;; 'updatedb' is a shell script that expects various ;; commands in $PATH. (setenv "PATH" (string-append #$package "/bin:" #$(canonical-package coreutils) "/bin:" #$(canonical-package sed) "/bin")) (execl #$(file-append package "/bin/updatedb") "updatedb" #$(string-append "--prunepaths=" (string-join excluded-directories))))))) (list #~(job #$schedule #$updatedb))))) (define file-database-service-type (service-type (name 'file-database) (extensions (list (service-extension mcron-service-type file-database-mcron-jobs))) (description "Periodically update the file database used by the @command{locate} command, which lets you search for files by name. The database is created by running the @command{updatedb} command.") (default-value (file-database-configuration)))) (define %default-package-database-update-schedule ;; Default mcron schedule for the periodic 'guix locate --update' job: once ;; every Monday. "10 23 * * 1") (define-configuration/no-serialization package-database-configuration (package (file-like guix) "The Guix package to use.") (schedule (string-or-gexp %default-package-database-update-schedule) "String or G-exp denoting an mcron schedule for the periodic @command{guix locate --update} job (@pxref{Guile Syntax,,, mcron, GNU@tie{}mcron}).") (method (symbol 'store) "Indexing method for @command{guix locate}. The default value, @code{'store}, yields a more complete database but is relatively expensive in terms of CPU and input/output.") (channels (gexp #~%default-channels) "G-exp denoting the channels to use when updating the database (@pxref{Channels}).")) (define (package-database-mcron-jobs configuration) (match-record configuration <package-database-configuration> (package schedule method channels) (let ((channels (scheme-file "channels.scm" channels))) (list #~(job #$schedule ;; XXX: The whole thing's running as "root" just because it ;; needs write access to /var/cache/guix/locate. (string-append #$(file-append package "/bin/guix") " time-machine -C " #$channels " -- locate --update --method=" #$(symbol->string method))))))) (define package-database-service-type (service-type (name 'package-database) (extensions (list (service-extension mcron-service-type package-database-mcron-jobs))) (description "Periodically update the package database used by the @code{guix locate} command, which lets you search for packages that provide a given file.") (default-value (package-database-configuration)))) ;;; ;;; Unattended upgrade. ;;; (define-record-type* <unattended-upgrade-configuration> unattended-upgrade-configuration make-unattended-upgrade-configuration unattended-upgrade-configuration? (operating-system-file unattended-upgrade-operating-system-file (default "/run/current-system/configuration.scm")) (operating-system-expression unattended-upgrade-operating-system-expression (default #f)) (schedule unattended-upgrade-configuration-schedule (default "30 01 * * 0")) (channels unattended-upgrade-configuration-channels (default #~%default-channels)) (services-to-restart unattended-upgrade-configuration-services-to-restart (default '(mcron))) (system-expiration unattended-upgrade-system-expiration (default (* 3 30 24 3600))) (maximum-duration unattended-upgrade-maximum-duration (default 3600)) (log-file unattended-upgrade-configuration-log-file (default %unattended-upgrade-log-file))) (define %unattended-upgrade-log-file "/var/log/unattended-upgrade.log") (define (unattended-upgrade-mcron-jobs config) (define channels (scheme-file "channels.scm" (unattended-upgrade-configuration-channels config))) (define log (unattended-upgrade-configuration-log-file config)) (define services (unattended-upgrade-configuration-services-to-restart config)) (define expiration (unattended-upgrade-system-expiration config)) (define config-file (unattended-upgrade-operating-system-file config)) (define expression (unattended-upgrade-operating-system-expression config)) (define arguments (if expression #~(list "-e" (object->string '#$expression)) #~(list #$config-file))) (define code (with-imported-modules (source-module-closure '((guix build utils) (gnu services herd))) #~(begin (use-modules (guix build utils) (gnu services herd) (srfi srfi-19) (srfi srfi-34)) (define log (open-file #$log "a0")) (define (timestamp) (date->string (time-utc->date (current-time time-utc)) "[~4]")) (define (alarm-handler . _) (format #t "~a time is up, aborting upgrade~%" (timestamp)) (exit 1)) ;; 'guix time-machine' needs X.509 certificates to authenticate the ;; Git host. (setenv "SSL_CERT_DIR" #$(file-append nss-certs "/etc/ssl/certs")) ;; Make sure the upgrade doesn't take too long. (sigaction SIGALRM alarm-handler) (alarm #$(unattended-upgrade-maximum-duration config)) ;; Redirect stdout/stderr to LOG to save the output of 'guix' below. (redirect-port log (current-output-port)) (redirect-port log (current-error-port)) (format #t "~a starting upgrade...~%" (timestamp)) (guard (c ((invoke-error? c) (report-invoke-error c))) (apply invoke #$(file-append guix "/bin/guix") "time-machine" "-C" #$channels "--" "system" "reconfigure" #$arguments) ;; 'guix system delete-generations' fails when there's no ;; matching generation. Thus, catch 'invoke-error?'. (guard (c ((invoke-error? c) (report-invoke-error c))) (invoke #$(file-append guix "/bin/guix") "system" "delete-generations" #$(string-append (number->string expiration) "s"))) (format #t "~a restarting services...~%" (timestamp)) (for-each restart-service '#$services) ;; XXX: If 'mcron' has been restarted, perhaps this isn't ;; reached. (format #t "~a upgrade complete~%" (timestamp)))))) (define upgrade (program-file "unattended-upgrade" code)) (list #~(job #$(unattended-upgrade-configuration-schedule config) #$upgrade))) (define (unattended-upgrade-log-rotations config) (list (log-rotation (files (list (unattended-upgrade-configuration-log-file config)))))) (define unattended-upgrade-service-type (service-type (name 'unattended-upgrade) (extensions (list (service-extension mcron-service-type unattended-upgrade-mcron-jobs) (service-extension rottlog-service-type unattended-upgrade-log-rotations))) (description "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) ;;; admin.scm ends here