all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phodina via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Sarah Morgensen <iskarian@mgsn.dev>, 49578@debbugs.gnu.org
Subject: [bug#49578] [PATCH] Add bolt
Date: Tue, 10 Jan 2023 02:49:12 +0000	[thread overview]
Message-ID: <i_AcBTkphIOGJxZRyfMDGzwmU5btRnviYWdsgzMca2454cog8oJMea0zvPLi_8zWFhcGCbKYYj8bYnHbU0mzquJQMazDUpMUOhS-W2NbOgw=@protonmail.com> (raw)
In-Reply-To: <87eds83c2u.fsf_-_@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi Ludo’,


removed the deprecated contruct make-forkexec-constructor/container and changed bolt into boltd.

Also added plasma-thunderbolt package and documentation for the service.

----
Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v5-0003-gnu-Add-plasma-thunderbolt.patch --]
[-- Type: text/x-patch; name=v5-0003-gnu-Add-plasma-thunderbolt.patch, Size: 1933 bytes --]

From 7b87d90d8bf6d6b8188f90f2308a1d96a7a2095c Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 14 Aug 2022 22:13:48 +0200
Subject: [PATCH v5 3/4] gnu: Add plasma-thunderbolt.

* gnu/packages/kde-plasma.scm (plasma-thunderbolt): New variable.

diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index 2a3d86f801..3a392bedc9 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -1477,6 +1477,40 @@ (define-public plasma-bigscreen
 is controllable via voice or TV remote.")
     (license license:gpl2+)))
 
+(define-public plasma-thunderbolt
+  (package
+    (name "plasma-thunderbolt")
+    (version "5.25.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://kde/stable/plasma/"
+                                  version
+                                  "/"
+                                  name
+                                  "-"
+                                  version
+                                  ".tar.xz"))
+              (sha256
+               (base32
+                "0hjvkss0qfmwhrsba83wfxwxhikvzf56faan325ic0iv7fdaj3ns"))))
+    (build-system qt-build-system)
+    (native-inputs (list dbus extra-cmake-modules))
+    (arguments
+     (list #:tests? #f))
+    (inputs (list bolt
+                  kcmutils
+                  kcoreaddons
+                  kdbusaddons
+                  kdeclarative
+                  ki18n
+                  knotifications
+                  qtdeclarative-5))
+    (home-page "https://invent.kde.org/plasma/plasma-thunderbolt")
+    (synopsis "Plasma integration for controlling Thunderbolt devices")
+    (description "This package provides Plasma integration for controlling
+Thunderbolt devices.")
+    (license (list license:bsd-3 license:gpl2 license:gpl3))))
+
 (define-public plasmatube
   (package
     (name "plasmatube")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: v5-0004-gnu-kinfocenter-Add-plasma-thunderbolt.patch --]
[-- Type: text/x-patch; name=v5-0004-gnu-kinfocenter-Add-plasma-thunderbolt.patch, Size: 917 bytes --]

From 0bea70cd8e565b6e03b756ca380ffc16274822c4 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Thu, 15 Dec 2022 10:26:08 +0100
Subject: [PATCH v5 4/4] gnu: kinfocenter: Add plasma-thunderbolt.

* gnu/packages/kde-plasma.scm (plasma-thunderbolt): New variable.

diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index 3a392bedc9..5904eba391 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -1416,7 +1416,7 @@ (define-public plasma
                              plasma-nm
                              plasma-pa
                              plasma-systemmonitor
-                             ;; plasma-thunderbolt ;; waiting for bolt
+                             plasma-thunderbolt
                              plasma-vault
                              plasma-workspace
                              plasma-workspace-wallpapers
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: v5-0001-gnu-Add-bolt-service-type.patch --]
[-- Type: text/x-patch; name=v5-0001-gnu-Add-bolt-service-type.patch, Size: 3511 bytes --]

From 64d4fe982b19440925895cf18e4be0385bcaaeeb Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 14 Dec 2022 23:23:48 +0100
Subject: [PATCH v5 1/4] gnu: Add bolt-service-type.

* gnu/services/linux.scm (bolt-service-type): New variable.

diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 60e2093e1d..3d0cb80b8b 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
 ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
+;;; Copyright © 2021-2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,15 +30,21 @@ (define-module (gnu services linux)
   #:use-module (guix i18n)
   #:use-module (guix ui)
   #:use-module (gnu services)
+  #:use-module (gnu services dbus)
   #:use-module (gnu services base)
   #:use-module (gnu services shepherd)
+  #:use-module (gnu system shadow)
   #:use-module (gnu packages linux)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
   #:use-module (ice-9 match)
-  #:export (earlyoom-configuration
+  #:export (boltd-configuration
+            boltd-configuration?
+            boltd-service-type
+
+            earlyoom-configuration
             earlyoom-configuration?
             earlyoom-configuration-earlyoom
             earlyoom-configuration-minimum-available-memory
@@ -65,6 +72,52 @@ (define-module (gnu services linux)
             zram-device-configuration-priority
             zram-device-service-type))
 
+\f
+;;;
+;;; Thunderbolt daemon.
+;;;
+
+(define-record-type* <boltd-configuration>
+  boltd-configuration make-boltd-configuration boltd-configuration?
+  (package boltd-configuration-package ; package
+           (default bolt)))
+
+(define boltd-activation-service
+  #~(begin
+      (use-modules (guix build utils))
+      (mkdir-p "/var/lib/boltd")))
+
+(define (boltd-shepherd-service config)
+  (shepherd-service (documentation "Run the boltd daemon.")
+                    (provision '(boltd))
+                    (requirement '(dbus-system udev))
+                    (start #~(make-forkexec-constructor (list (string-append #$bolt
+                                                               "/libexec/boltd"))))
+                    (stop #~(make-kill-destructor))))
+
+(define (boltd-udev-rule config)
+  (let ((package (boltd-configuration-package config)))
+  (file->udev-rule "90-bolt.rules" (file-append package
+  "/lib/udev/rules.d/90-bolt.rules"))))
+
+
+(define boltd-service-type
+  (service-type (name 'boltd)
+                (default-value (boltd-configuration))
+   (extensions
+    (list (service-extension udev-service-type
+			     (compose list boltd-udev-rule))
+	  (service-extension dbus-root-service-type
+	  (compose list boltd-configuration-package))
+                (service-extension activation-service-type
+                                                     (const
+                                                      boltd-activation-service))
+                                  (service-extension
+                                   shepherd-root-service-type
+                                   (compose list boltd-shepherd-service))))
+                (description
+                 "Run @command{boltd}, the Thunderbolt daemon.")))
+
 \f
 ;;;
 ;;; Early OOM daemon.
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: v5-0002-gnu-linux-Add-boltd-service-type.patch --]
[-- Type: text/x-patch; name=v5-0002-gnu-linux-Add-boltd-service-type.patch, Size: 1717 bytes --]

From 51112a1d2a5a1fadeafce288270aa5ea17cc23b7 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 10 Jan 2023 03:15:27 +0100
Subject: [PATCH v5 2/4] gnu: linux: Add boltd-service-type.

* doc/guix.texi ("Linux Services")[boltd-service-type]: Document them.

diff --git a/doc/guix.texi b/doc/guix.texi
index aef3890298..fbd006f120 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36940,6 +36940,38 @@ The database location is hard-coded to @file{/var/lib/rasdaemon/ras-mc_event.db}
 @end table
 @end deftp
 
+@cindex boltd
+@cindex thunderbolt daemon
+@cindex Thunderbolt daemon
+@subsubheading Thunderbolt daemon Service
+
+The Thunderbolt daemon service provides a managment for the Thunderbolt 3
+interface bus found on newer machines.  The daemon configures
+the Thunderbolt security levels:
+@itemize
+@item No security - device works without requesting authorization
+@item User authorization - user must approve the device first
+@item Secure Connect - uses pre-shared keys to approve specific devices
+@item Display Port Only - port functions only as a video output
+@end itemize
+
+@deffn {Scheme Variable} boltd-device-service-type
+This service starts the @code{boltd} daemon that manages the connected device
+on the Thunderbolt bus.  The service's value is a
+@code{boltd-device-configuration} record.
+
+@deftp {Data Type} boltd-device-configuration
+This is the data type representing the configuration for the boltd-device
+service.
+
+@table @asis
+@item @code{bolt} (default @code{bolt})
+This is the default package that will be used.
+@end table
+
+@end deftp
+@end deffn
+
 @cindex zram
 @cindex compressed swap
 @cindex Compressed RAM-based block devices
-- 
2.38.1


  reply	other threads:[~2023-01-10  2:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 16:46 [bug#49578] [PATCH] Add bolt phodina via Guix-patches via
2021-07-22  1:50 ` Sarah Morgensen
2021-07-22 11:32   ` phodina via Guix-patches via
2021-07-22 11:36     ` phodina via Guix-patches via
2021-07-22 20:02       ` Sarah Morgensen
2021-09-18 11:20 ` [bug#49578] [PATCH v3 1/2] gnu: " phodina via Guix-patches via
2021-09-23  1:11   ` Sarah Morgensen
2021-11-05  8:39     ` phodina via Guix-patches via
2022-08-14 22:00       ` [bug#49578] [PATCH v4] " phodina via Guix-patches via
2022-12-14 11:22         ` [bug#49578] [PATCH] " Ludovic Courtès
2023-01-05 21:28         ` Ludovic Courtès
2023-01-10  2:49           ` phodina via Guix-patches via [this message]
2021-09-18 11:21 ` [bug#49578] [PATCH v3 2/2] services: Add a service for bolt phodina via Guix-patches via
2022-01-22  6:55 ` [bug#49578] [PATCH] Add bolt David Conner
2022-02-02 16:19   ` David Conner

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='i_AcBTkphIOGJxZRyfMDGzwmU5btRnviYWdsgzMca2454cog8oJMea0zvPLi_8zWFhcGCbKYYj8bYnHbU0mzquJQMazDUpMUOhS-W2NbOgw=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=49578@debbugs.gnu.org \
    --cc=iskarian@mgsn.dev \
    --cc=ludo@gnu.org \
    --cc=phodina@protonmail.com \
    /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.