diff options
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/base.scm | 49 | ||||
-rw-r--r-- | gnu/services/messaging.scm | 6 | ||||
-rw-r--r-- | gnu/services/sddm.scm | 7 | ||||
-rw-r--r-- | gnu/services/shepherd.scm | 13 | ||||
-rw-r--r-- | gnu/services/xorg.scm | 2 |
5 files changed, 64 insertions, 13 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 60388a22dd..cd61df718e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013-2023 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013-2024 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com> ;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> @@ -83,6 +83,7 @@ #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask swap-space->flags-bit-mask)) + #:autoload (guix channels) (%default-channels channel->code) #:use-module (guix gexp) #:use-module (guix records) #:use-module (guix modules) @@ -211,6 +212,7 @@ guix-configuration-use-substitutes? guix-configuration-substitute-urls guix-configuration-generate-substitute-key? + guix-configuration-channels guix-configuration-extra-options guix-configuration-log-file guix-configuration-environment @@ -1740,6 +1742,31 @@ archive' public keys, with GUIX." ;; Installed the declared ACL. (symlink #+default-acl acl-file)))) +(define (install-channels-file channels) + "Return a gexp with code to install CHANNELS, a list of channels, in +/etc/guix/channels.scm." + (define channels-file + (scheme-file "channels.scm" + `(list ,@(map channel->code channels)))) + + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + ;; If channels.scm already exists, move it out of the way. Create a + ;; backup if it's a regular file: it's likely that the user + ;; manually defined it. + (if (file-exists? "/etc/guix/channels.scm") + (if (and (symbolic-link? "/etc/guix/channels.scm") + (store-file-name? (readlink "/etc/guix/channels.scm"))) + (delete-file "/etc/guix/channels.scm") + (rename-file "/etc/guix/channels.scm" + "/etc/guix/channels.scm.bak")) + (mkdir-p "/etc/guix")) + + ;; Installed the declared channels. + (symlink #+channels-file "/etc/guix/channels.scm")))) + (define %default-authorized-guix-keys ;; List of authorized substitute keys. (list (file-append guix "/share/guix/berlin.guix.gnu.org.pub") @@ -1795,6 +1822,8 @@ archive' public keys, with GUIX." (default %default-substitute-urls)) (generate-substitute-key? guix-configuration-generate-substitute-key? (default #t)) ;Boolean + (channels guix-configuration-channels ;file-like + (default %default-channels)) (chroot-directories guix-configuration-chroot-directories ;list of file-like/strings (default '())) (max-silent-time guix-configuration-max-silent-time ;integer @@ -1988,7 +2017,7 @@ proxy of 'guix-daemon'...~%") (define (guix-activation config) "Return the activation gexp for CONFIG." (match-record config <guix-configuration> - (guix generate-substitute-key? authorize-key? authorized-keys) + (guix generate-substitute-key? authorize-key? authorized-keys channels) #~(begin ;; Assume that the store has BUILD-GROUP as its group. We could ;; otherwise call 'chown' here, but the problem is that on a COW overlayfs, @@ -2005,6 +2034,9 @@ proxy of 'guix-daemon'...~%") (substitute-key-authorization authorized-keys guix) #~#f) + ;; ... and /etc/guix/channels.scm... + #$(and channels (install-channels-file channels)) + ;; ... and /etc/guix/machines.scm. #$(if (guix-build-machines config) (guix-machines-files-installation @@ -2174,15 +2206,10 @@ raise a deprecation warning if the 'compression-level' field was used." ;; Use lazy socket activation unless ADVERTISE? is true: in that ;; case the process should start right away to advertise itself. - (start #~(if (and (defined? 'make-systemd-constructor) ;> 0.9.0? - #$(not advertise?)) - (make-systemd-constructor - #$command #$endpoints #$@options) - (make-forkexec-constructor #$command #$@options))) - (stop #~(if (and (defined? 'make-systemd-destructor) - #$(not advertise?)) - (make-systemd-destructor) - (make-kill-destructor)))))))) + (start #~(make-systemd-constructor + #$command #$endpoints #$@options + #:lazy-start? #$(not advertise?))) + (stop #~(make-systemd-destructor))))))) (define %guix-publish-accounts (list (user-group (name "guix-publish") (system? #t)) diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm index 9702170b3e..a914d0f89e 100644 --- a/gnu/services/messaging.scm +++ b/gnu/services/messaging.scm @@ -427,6 +427,12 @@ See @url{https://prosody.im/doc/modules/mod_tls}." @url{https://prosody.im/doc/modules/mod_saslauth}." common) + (insecure-sasl-mechanisms + (string-list '("PLAIN" "LOGIN")) + "Set of mechanisms that will not be offered on unencrypted connections. +See @url{https://prosody.im/doc/modules/mod_saslauth}." + common) + (s2s-require-encryption? (boolean #f) "Whether to force all server-to-server connections to be encrypted or not. diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index 69c737829b..48695e2806 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com> ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> +;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -328,7 +329,11 @@ Relogin=" (if (sddm-configuration-relogin? config) (service-extension account-service-type (const %sddm-accounts)) (service-extension profile-service-type - sddm-profile-service))) + sddm-profile-service) + (service-extension localed-service-type + (compose + xorg-configuration-keyboard-layout + sddm-configuration-xorg)))) (default-value (sddm-configuration)) (description "Run SDDM, a display and log-in manager for X11 and diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index f5bcde721f..455e972535 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -383,6 +383,12 @@ as shepherd package." (use-modules (srfi srfi-34) (system repl error-handling)) + (define (make-user-module) + ;; Copied from (shepherd support), where it's private. + (let ((m (make-fresh-user-module))) + (module-use! m (resolve-interface '(shepherd service))) + m)) + ;; There's code run from shepherd that uses 'call-with-input-file' & ;; co.--e.g., the 'urandom-seed' service. Starting from Shepherd ;; 0.9.2, users need to make sure not to leak non-close-on-exec file @@ -416,7 +422,12 @@ as shepherd package." (register-services (parameterize ((current-warning-port (%make-void-port "w"))) - (map load-compiled '#$(map scm->go files)))))) + (map (lambda (file) + (save-module-excursion + (lambda () + (set-current-module (make-user-module)) + (load-compiled file)))) + '#$(map scm->go files)))))) (format #t "starting services...~%") (let ((services-to-start diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 1ee15ea90c..b86e2d3c5b 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2022 Chris Marusich <cmmarusich@gmail.com> ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2023 muradm <mail@muradm.net> +;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,6 +78,7 @@ xorg-configuration-extra-config xorg-configuration-server xorg-configuration-server-arguments + xorg-configuration-keyboard-layout %default-xorg-modules %default-xorg-fonts |