all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Craven <david@craven.ch>
To: guix-devel@gnu.org
Cc: David Craven <david@craven.ch>
Subject: [PATCH 8/8] services: Add spice vdagent service.
Date: Fri, 29 Jul 2016 10:23:57 +0200	[thread overview]
Message-ID: <20160729082357.17501-8-david@craven.ch> (raw)
In-Reply-To: <20160729082357.17501-1-david@craven.ch>

* gnu/services/spice.scm: New file.
* gnu/packages/spice.scm (spice-vdagent): Set Exec path in
spice-vdagent.desktop.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk           |  1 +
 gnu/packages/spice.scm |  5 +++++
 gnu/services/spice.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+)
 create mode 100644 gnu/services/spice.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index c789b19..0fce83a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -384,6 +384,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/networking.scm			\
   %D%/services/shepherd.scm			\
   %D%/services/herd.scm				\
+  %D%/services/spice.scm				\
   %D%/services/ssh.scm				\
   %D%/services/web.scm				\
   %D%/services/xorg.scm				\
diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm
index 1a356b0..1b538fc 100644
--- a/gnu/packages/spice.scm
+++ b/gnu/packages/spice.scm
@@ -235,6 +235,11 @@ Internet and from a wide variety of machine architectures.")
                (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
                                 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
                  "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
+             #t))
+         (add-after 'unpack 'patch-spice-vdagent.desktop
+           (lambda _
+             (substitute* "data/spice-vdagent.desktop"
+                 (("Exec=/usr/bin/spice-vdagent\n") "Exec=spice-vdagent\n"))
              #t)))))
     (inputs
       `(("alsa-lib" ,alsa-lib)
diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm
new file mode 100644
index 0000000..ff8f2a2
--- /dev/null
+++ b/gnu/services/spice.scm
@@ -0,0 +1,55 @@
+(define-module (gnu services spice)
+  #:use-module (gnu packages spice)
+  #:use-module (gnu services)
+  #:use-module (gnu services shepherd)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+  #:export (spice-vdagent-configuration
+            spice-vdagent-configuration?
+            spice-vdagent-service-type
+            spice-vdagent-service))
+
+(define-record-type* <spice-vdagent-configuration>
+  spice-vdagent-configuration make-spice-vdagent-configuration
+  spice-vdagent-configuration?
+  (spice-vdagent spice-vdagent-configuration-spice-vdagent
+                 (default spice-vdagent)))
+
+(define (spice-vdagent-activation config)
+  "Return the activation gexp for CONFIG."
+  #~(mkdir-p "/var/run/spice-vdagentd"))
+
+(define (spice-vdagent-shepherd-service config)
+  "Return a <shepherd-service> for spice-vdagentd with CONFIG."
+  (define spice-vdagent (spice-vdagent-configuration-spice-vdagent config))
+
+  (define spice-vdagentd-command
+    (list
+      #~(string-append #$spice-vdagent "/sbin/spice-vdagentd")
+      "-x"))
+
+  (list
+    (shepherd-service
+      (documentation "Spice vdagentd service")
+      (requirement '(udev))
+      (provision '(spice-vdagentd))
+      (start #~(make-forkexec-constructor #$@spice-vdagentd-command))
+      (stop #~(make-kill-destructor)))))
+
+(define spice-vdagent-service-type
+  (service-type (name 'spice-vdagent)
+    (extensions
+      (list (service-extension shepherd-root-service-type
+                               spice-vdagent-shepherd-service)
+            (service-extension activation-service-type
+                               spice-vdagent-activation)
+            (service-extension profile-service-type
+                               (compose list
+                                 spice-vdagent-configuration-spice-vdagent))))))
+
+(define* (spice-vdagent-service
+          #:optional (config (spice-vdagent-configuration)))
+  "Start the @command{vdagentd} and @command{vdagent} deamons
+from @var{spice-vdagent} to enable guest window resizing and
+clipboard sharing."
+  (service spice-vdagent-service-type config))
-- 
2.9.0

  parent reply	other threads:[~2016-07-29  8:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  8:23 [PATCH 1/8] gnu: qt: Update to 5.6.1-1 David Craven
2016-07-29  8:23 ` [PATCH 2/8] gnu: Use define-public to export packages David Craven
2016-07-29 15:35   ` Ludovic Courtès
2016-07-29  8:23 ` [PATCH 3/8] gnu: Remove trailing periods from synopsis David Craven
2016-07-29 15:38   ` Ludovic Courtès
2016-07-29  8:23 ` [PATCH 4/8] gnu: freedesktop: Add libinput-minimal David Craven
2016-07-29 11:25   ` Vincent Legoll
2016-07-29 12:53     ` David Craven
2016-07-29 13:13       ` Vincent Legoll
2016-07-29 15:40   ` Ludovic Courtès
2016-07-29  8:23 ` [PATCH 5/8] gnu: xorg: Add xf86-video-qxl David Craven
2016-07-29 15:42   ` Ludovic Courtès
2016-07-29  8:23 ` [PATCH 6/8] gnu: Order module imports in (gnu packages qemu) alphabetically David Craven
2016-07-29 15:44   ` Ludovic Courtès
2016-07-29 16:26     ` David Craven
2016-07-29  8:23 ` [PATCH 7/8] gnu: qemu: Enable spice support David Craven
2016-07-29 19:10   ` Ludovic Courtès
2016-07-29 19:12     ` David Craven
2016-07-30 12:47     ` Ludovic Courtès
2016-07-29  8:23 ` David Craven [this message]
2016-07-29 19:16   ` [PATCH 8/8] services: Add spice vdagent service Ludovic Courtès
2016-07-29 19:20     ` David Craven
2016-07-30 10:29       ` David Craven
2016-07-30 22:41         ` Ludovic Courtès
2016-07-31 18:14           ` David Craven
2016-08-01 12:01             ` Ludovic Courtès
2016-07-29 19:20 ` [PATCH 1/8] gnu: qt: Update to 5.6.1-1 Ludovic Courtès
2016-07-29 19:23   ` David Craven
2016-07-30  8:57   ` Andreas Enge
2016-07-30 22:44     ` Code formatting Ludovic Courtès
2016-07-31 10:34       ` Danny Milosavljevic
2016-07-31 10:37         ` Andreas Enge
2016-07-31 10:59         ` Ludovic Courtès
2016-09-11 16:35           ` Andreas Enge
     [not found] ` <20160729101510.GA30683@solar>
     [not found]   ` <CAL1_im=qJ3=0P=c6OhL9wW2rz4wJY3cFubute0dHWyr5ymjhsA@mail.gmail.com>
     [not found]     ` <CAL1_im=EbMqBufpsW2eMxYZdLWVDtmq4TD1HDKvAQ_u_RpdjXw@mail.gmail.com>
     [not found]       ` <20160729180053.GA1301@solar>
2016-07-30  8:53         ` [PATCH 1/8] gnu: qt: Update to 5.6.1-1 Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160729082357.17501-8-david@craven.ch \
    --to=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.