diff options
| author | Mathieu Othacehe <othacehe@gnu.org> | 2020-11-22 15:15:17 +0100 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-11-29 15:08:26 +0100 |
| commit | 276e494b2a1fd87874d80e2bdc3aa1fb833b76f2 (patch) | |
| tree | 852860bd1aea0bb32ca3946d58b5d3876c4ae260 /gnu | |
| parent | 375cc7dea20da7117c9459e4a4d15144095e015b (diff) | |
publish: Add advertising support.
* guix/scripts/publish.scm (%options): Add "--advertise" option.
(show-help): Document it.
(service-name): New procedure,
(publish-service-type): new variable.
(run-publish-server): Add "advertise?" and "port" parameters. Use them to publish
the server using Avahi.
(guix-publish): Pass the "advertise?" option to "run-publish-server".
* gnu/services/base.scm (<guix-publish-configuration>): Add "advertise?"
field.
(guix-publish-shepherd-service): Honor it.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/services/base.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 3fc4d5f8857..e3b347293ef 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm | |||
| @@ -1744,6 +1744,8 @@ proxy of 'guix-daemon'...~%") | |||
| 1744 | (default 80)) | 1744 | (default 80)) |
| 1745 | (host guix-publish-configuration-host ;string | 1745 | (host guix-publish-configuration-host ;string |
| 1746 | (default "localhost")) | 1746 | (default "localhost")) |
| 1747 | (advertise? guix-publish-advertise? ;boolean | ||
| 1748 | (default #f)) | ||
| 1747 | (compression guix-publish-configuration-compression | 1749 | (compression guix-publish-configuration-compression |
| 1748 | (thunked) | 1750 | (thunked) |
| 1749 | (default (default-compression this-record | 1751 | (default (default-compression this-record |
| @@ -1790,7 +1792,8 @@ raise a deprecation warning if the 'compression-level' field was used." | |||
| 1790 | lst)))) | 1792 | lst)))) |
| 1791 | 1793 | ||
| 1792 | (match-record config <guix-publish-configuration> | 1794 | (match-record config <guix-publish-configuration> |
| 1793 | (guix port host nar-path cache workers ttl cache-bypass-threshold) | 1795 | (guix port host nar-path cache workers ttl cache-bypass-threshold |
| 1796 | advertise?) | ||
| 1794 | (list (shepherd-service | 1797 | (list (shepherd-service |
| 1795 | (provision '(guix-publish)) | 1798 | (provision '(guix-publish)) |
| 1796 | (requirement '(guix-daemon)) | 1799 | (requirement '(guix-daemon)) |
| @@ -1801,6 +1804,9 @@ raise a deprecation warning if the 'compression-level' field was used." | |||
| 1801 | #$@(config->compression-options config) | 1804 | #$@(config->compression-options config) |
| 1802 | (string-append "--nar-path=" #$nar-path) | 1805 | (string-append "--nar-path=" #$nar-path) |
| 1803 | (string-append "--listen=" #$host) | 1806 | (string-append "--listen=" #$host) |
| 1807 | #$@(if advertise? | ||
| 1808 | #~("--advertise") | ||
| 1809 | #~()) | ||
| 1804 | #$@(if workers | 1810 | #$@(if workers |
| 1805 | #~((string-append "--workers=" | 1811 | #~((string-append "--workers=" |
| 1806 | #$(number->string | 1812 | #$(number->string |
