diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-06-04 22:19:30 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-06-04 22:19:30 +0200 |
| commit | 185f669109eb56b61c3d51dc8b2e3eeded9b2be9 (patch) | |
| tree | 8024e91e4f644e3de117307fe4c08510f820ad41 /gnu | |
| parent | 3d116a70f9b18027b31be2e11e8c9c9192622607 (diff) | |
services: Make sure the store's group is the build group.
* gnu/services/base.scm (guix-service)[activate]: New variable. Add
'chown' call for (%store-prefix). Set the 'activate' field to
ACTIVATE.
* guix/build/install.scm (directives): Add comment about STORE's group.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/services/base.scm | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 3f7f453c9bc..94fa919c0f9 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | 18 | ||
| 19 | (define-module (gnu services base) | 19 | (define-module (gnu services base) |
| 20 | #:use-module ((guix store) | ||
| 21 | #:select (%store-prefix)) | ||
| 20 | #:use-module (gnu services) | 22 | #:use-module (gnu services) |
| 21 | #:use-module (gnu system shadow) ; 'user-account', etc. | 23 | #:use-module (gnu system shadow) ; 'user-account', etc. |
| 22 | #:use-module (gnu system linux) ; 'pam-service', etc. | 24 | #:use-module (gnu system linux) ; 'pam-service', etc. |
| @@ -348,7 +350,6 @@ GUIX." | |||
| 348 | (port (open-file key "r0b"))) | 350 | (port (open-file key "r0b"))) |
| 349 | (format #t "registering public key '~a'...~%" key) | 351 | (format #t "registering public key '~a'...~%" key) |
| 350 | (close-port (current-input-port)) | 352 | (close-port (current-input-port)) |
| 351 | ;; (close-fdes 0) | ||
| 352 | (dup port 0) | 353 | (dup port 0) |
| 353 | (execl (string-append #$guix "/bin/guix") | 354 | (execl (string-append #$guix "/bin/guix") |
| 354 | "guix" "archive" "--authorize") | 355 | "guix" "archive" "--authorize") |
| @@ -367,6 +368,18 @@ BUILD-ACCOUNTS user accounts available under BUILD-USER-GID. | |||
| 367 | When AUTHORIZE-HYDRA-KEY? is true, the hydra.gnu.org public key provided by | 368 | When AUTHORIZE-HYDRA-KEY? is true, the hydra.gnu.org public key provided by |
| 368 | GUIX is authorized upon activation, meaning that substitutes from | 369 | GUIX is authorized upon activation, meaning that substitutes from |
| 369 | hydra.gnu.org are used by default." | 370 | hydra.gnu.org are used by default." |
| 371 | (define activate | ||
| 372 | #~(begin | ||
| 373 | ;; Make sure the store has BUILDER-GROUP as its group. This may fail | ||
| 374 | ;; with EACCES when the store is a 9p mount, so catch exceptions. | ||
| 375 | (false-if-exception | ||
| 376 | (chown #$(%store-prefix) 0 | ||
| 377 | (group:gid (getgrnam #$builder-group)))) | ||
| 378 | |||
| 379 | ;; Optionally authorize hydra.gnu.org's key. | ||
| 380 | #$(and authorize-hydra-key? | ||
| 381 | (hydra-key-authorization guix)))) | ||
| 382 | |||
| 370 | (mlet %store-monad ((accounts (guix-build-accounts build-accounts | 383 | (mlet %store-monad ((accounts (guix-build-accounts build-accounts |
| 371 | #:group builder-group))) | 384 | #:group builder-group))) |
| 372 | (return (service | 385 | (return (service |
| @@ -383,8 +396,7 @@ hydra.gnu.org are used by default." | |||
| 383 | (name builder-group) | 396 | (name builder-group) |
| 384 | (members (map user-account-name | 397 | (members (map user-account-name |
| 385 | user-accounts))))) | 398 | user-accounts))))) |
| 386 | (activate (and authorize-hydra-key? | 399 | (activate activate))))) |
| 387 | (hydra-key-authorization guix))))))) | ||
| 388 | 400 | ||
| 389 | (define %base-services | 401 | (define %base-services |
| 390 | ;; Convenience variable holding the basic services. | 402 | ;; Convenience variable holding the basic services. |
