diff options
Diffstat (limited to 'gnu/services/networking.scm')
| -rw-r--r-- | gnu/services/networking.scm | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index af2a60936b0..a77ed3bb80b 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> | 4 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
| 5 | ;;; | 5 | ;;; |
| @@ -345,39 +345,39 @@ keep the system clock synchronized with that of @var{servers}." | |||
| 345 | (($ <tor-configuration> tor config-file services) | 345 | (($ <tor-configuration> tor config-file services) |
| 346 | (computed-file | 346 | (computed-file |
| 347 | "torrc" | 347 | "torrc" |
| 348 | #~(begin | 348 | (with-imported-modules '((guix build utils)) |
| 349 | (use-modules (guix build utils) | 349 | #~(begin |
| 350 | (ice-9 match)) | 350 | (use-modules (guix build utils) |
| 351 | 351 | (ice-9 match)) | |
| 352 | (call-with-output-file #$output | 352 | |
| 353 | (lambda (port) | 353 | (call-with-output-file #$output |
| 354 | (display "\ | 354 | (lambda (port) |
| 355 | (display "\ | ||
| 355 | # The beginning was automatically added. | 356 | # The beginning was automatically added. |
| 356 | User tor | 357 | User tor |
| 357 | DataDirectory /var/lib/tor | 358 | DataDirectory /var/lib/tor |
| 358 | Log notice syslog\n" port) | 359 | Log notice syslog\n" port) |
| 359 | 360 | ||
| 360 | (for-each (match-lambda | 361 | (for-each (match-lambda |
| 361 | ((service (ports hosts) ...) | 362 | ((service (ports hosts) ...) |
| 362 | (format port "\ | 363 | (format port "\ |
| 363 | HiddenServiceDir /var/lib/tor/hidden-services/~a~%" | 364 | HiddenServiceDir /var/lib/tor/hidden-services/~a~%" |
| 364 | service) | 365 | service) |
| 365 | (for-each (lambda (tcp-port host) | 366 | (for-each (lambda (tcp-port host) |
| 366 | (format port "\ | 367 | (format port "\ |
| 367 | HiddenServicePort ~a ~a~%" | 368 | HiddenServicePort ~a ~a~%" |
| 368 | tcp-port host)) | 369 | tcp-port host)) |
| 369 | ports hosts))) | 370 | ports hosts))) |
| 370 | '#$(map (match-lambda | 371 | '#$(map (match-lambda |
| 371 | (($ <hidden-service> name mapping) | 372 | (($ <hidden-service> name mapping) |
| 372 | (cons name mapping))) | 373 | (cons name mapping))) |
| 373 | services)) | 374 | services)) |
| 374 | 375 | ||
| 375 | ;; Append the user's config file. | 376 | ;; Append the user's config file. |
| 376 | (call-with-input-file #$config-file | 377 | (call-with-input-file #$config-file |
| 377 | (lambda (input) | 378 | (lambda (input) |
| 378 | (dump-port input port))) | 379 | (dump-port input port))) |
| 379 | #t))) | 380 | #t)))))))) |
| 380 | #:modules '((guix build utils)))))) | ||
| 381 | 381 | ||
| 382 | (define (tor-shepherd-service config) | 382 | (define (tor-shepherd-service config) |
| 383 | "Return a <shepherd-service> running TOR." | 383 | "Return a <shepherd-service> running TOR." |
