unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59971: iwd is packaged but there is no iwd shepherd service
@ 2022-12-11 17:10 Jeremiah
  2022-12-23  7:35 ` Hilton Chain via Bug reports for GNU Guix
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeremiah @ 2022-12-11 17:10 UTC (permalink / raw)
  To: 59971

without a proper shepherd service, users are forced to manually start
the iwd service as root and background the process.

Nor is there any documentation provided to work around this defect.

-Jeremiah




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59971: iwd is packaged but there is no iwd shepherd service
  2022-12-11 17:10 bug#59971: iwd is packaged but there is no iwd shepherd service Jeremiah
@ 2022-12-23  7:35 ` Hilton Chain via Bug reports for GNU Guix
  2022-12-23 12:19   ` Jeremiah
  2023-11-11 11:31 ` bug#59971: Jack Faller
  2023-11-11 14:27 ` bug#59971: iwd is packaged but there is no iwd shepherd service Jack Faller
  2 siblings, 1 reply; 7+ messages in thread
From: Hilton Chain via Bug reports for GNU Guix @ 2022-12-23  7:35 UTC (permalink / raw)
  To: Jeremiah; +Cc: 59971

Hi Jeremiah,

> without a proper shepherd service, users are forced to manually start
> the iwd service as root and background the process.
>
> Nor is there any documentation provided to work around this defect.

AFAIK, Nikita Domnitskii has defined an iwd-service-type in their dotfiles:
<https://git.sr.ht/~krevedkokun/dotfiles/tree/master/item/channel/system/services/networking.scm>




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59971: iwd is packaged but there is no iwd shepherd service
  2022-12-23  7:35 ` Hilton Chain via Bug reports for GNU Guix
@ 2022-12-23 12:19   ` Jeremiah
  2022-12-23 16:00     ` Nikita Domnitskii via Bug reports for GNU Guix
  0 siblings, 1 reply; 7+ messages in thread
From: Jeremiah @ 2022-12-23 12:19 UTC (permalink / raw)
  To: Hilton Chain; +Cc: 59971

Well it is nice to see that someone made a iwd-servce-type, perhaps it
should be integrated into guix services, so that we don't have to copy
that into our configuration or import a channel to run a basic iwd
service.

-Jeremiah




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59971: iwd is packaged but there is no iwd shepherd service
  2022-12-23 12:19   ` Jeremiah
@ 2022-12-23 16:00     ` Nikita Domnitskii via Bug reports for GNU Guix
  2022-12-23 22:18       ` Jeremiah
  0 siblings, 1 reply; 7+ messages in thread
From: Nikita Domnitskii via Bug reports for GNU Guix @ 2022-12-23 16:00 UTC (permalink / raw)
  To: Jeremiah, Hilton Chain; +Cc: 59971

Jeremiah@pdp10.guru writes:

> Well it is nice to see that someone made a iwd-servce-type, perhaps it
> should be integrated into guix services, so that we don't have to copy
> that into our configuration or import a channel to run a basic iwd
> service.
Well, I haven't upstreamed it yet because it's not very idiomatic for
guix (alists instead of records) and there is dependency on Andrew
Tropin rde channel. Feel free to borrow some code for use in guix though

-- 
Best Regards,
Nikita Domnitskii




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59971: iwd is packaged but there is no iwd shepherd service
  2022-12-23 16:00     ` Nikita Domnitskii via Bug reports for GNU Guix
@ 2022-12-23 22:18       ` Jeremiah
  0 siblings, 0 replies; 7+ messages in thread
From: Jeremiah @ 2022-12-23 22:18 UTC (permalink / raw)
  To: Nikita Domnitskii; +Cc: hako, 59971

> Well, I haven't upstreamed it yet because it's not very idiomatic for
> guix (alists instead of records) and there is dependency on Andrew
> Tropin rde channel. Feel free to borrow some code for use in guix though
completely fair
and thank you for making the details needed more clear with your work
^_^

-Jeremiah




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59971:
  2022-12-11 17:10 bug#59971: iwd is packaged but there is no iwd shepherd service Jeremiah
  2022-12-23  7:35 ` Hilton Chain via Bug reports for GNU Guix
@ 2023-11-11 11:31 ` Jack Faller
  2023-11-11 14:27 ` bug#59971: iwd is packaged but there is no iwd shepherd service Jack Faller
  2 siblings, 0 replies; 7+ messages in thread
From: Jack Faller @ 2023-11-11 11:31 UTC (permalink / raw)
  To: 59971


[-- Attachment #1.1: Type: text/plain, Size: 107 bytes --]

Not sure if this is useful for anyone, but here is a version I have been
using without the RDE dependency.

[-- Attachment #1.2: Type: text/html, Size: 128 bytes --]

[-- Attachment #2: iwd-service.scm --]
[-- Type: text/x-scheme, Size: 3392 bytes --]

(define-module (iwd-service)
  #:export (iwd-configuration
            iwd-configuration?
            iwd-configuration-iwd
            iwd-configuration-openresolv
            iwd-configuration-coreutils
            iwd-configuration-config-file
            iwd-service-type)

  #:use-module (gnu)
  #:use-module (gnu services)
  #:use-module (gnu system setuid)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages dns)
  #:use-module (gnu services admin)
  #:use-module (gnu services dbus)
  #:use-module (gnu services base)
  #:use-module (gnu services shepherd)
  #:use-module (gnu services configuration)

  #:use-module (guix gexp)
  #:use-module (guix records))

(define-record-type* <iwd-configuration>
  iwd-configuration make-iwd-configuration
  iwd-configuration?
  (iwd iwd-configuration-iwd (default iwd))
  (coreutils coreutils-configuration-coreutils (default coreutils))
  (openresolv openresolv-configuration-openresolv (default openresolv))
  (config-file iwd-configuration-config-file
               (default (plain-file "iwd-main.conf"
                                    (string-join
                                     '("[General]"
                                       "EnableNetworkConfiguration=true"
                                       "[Network]"
                                       "NameResolvingService=resolvconf")
                                     "\n" 'suffix)))))

(define (iwd-shepherd-service config)
  (match-record config <iwd-configuration> (iwd openresolv coreutils)
    (let ((environment #~(list (string-append
                                "PATH=" (string-append #$openresolv "/sbin")
                                ":" (string-append #$coreutils "/bin")))))
      (list (shepherd-service
             (documentation "Run Iwd")
             (provision '(iwd networking))
             (requirement '(user-processes dbus-system loopback))
             (start #~(make-forkexec-constructor
                       (list (string-append #$iwd "/libexec/iwd"))
                       #:log-file "/var/log/iwd.log"
                       #:environment-variables #$environment))
             (stop #~(make-kill-destructor)))))))

(define %iwd-log-rotation
  (list (log-rotation (files '("/var/log/iwd.log")))))

(define (iwd-etc-service config)
  (match-record config <iwd-configuration> (config-file)
    `(("iwd/main.conf" ,config-file))))

(define iwd-service-type
  (let ((add-iwd-package (compose list iwd-configuration-iwd)))
    (service-type (name 'iwd)
                  (extensions
                   (list (service-extension shepherd-root-service-type
                                            iwd-shepherd-service)
                         (service-extension dbus-root-service-type
                                            add-iwd-package)
                         (service-extension profile-service-type
                                            add-iwd-package)
                         (service-extension etc-service-type
                                            iwd-etc-service)
                         (service-extension rottlog-service-type
                                            (const %iwd-log-rotation))))
                  (default-value (iwd-configuration))
                  (description
                   "Run @url{https://iwd.wiki.kernel.org/,Iwd},
a network connection manager."))))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59971: iwd is packaged but there is no iwd shepherd service
  2022-12-11 17:10 bug#59971: iwd is packaged but there is no iwd shepherd service Jeremiah
  2022-12-23  7:35 ` Hilton Chain via Bug reports for GNU Guix
  2023-11-11 11:31 ` bug#59971: Jack Faller
@ 2023-11-11 14:27 ` Jack Faller
  2 siblings, 0 replies; 7+ messages in thread
From: Jack Faller @ 2023-11-11 14:27 UTC (permalink / raw)
  To: 59971


[-- Attachment #1.1: Type: text/plain, Size: 107 bytes --]

Not sure if this is useful for anyone, but here is a version I have been
using without the RDE dependency.

[-- Attachment #1.2: Type: text/html, Size: 586 bytes --]

[-- Attachment #2: iwd-service.scm --]
[-- Type: text/x-scheme, Size: 3392 bytes --]

(define-module (iwd-service)
  #:export (iwd-configuration
            iwd-configuration?
            iwd-configuration-iwd
            iwd-configuration-openresolv
            iwd-configuration-coreutils
            iwd-configuration-config-file
            iwd-service-type)

  #:use-module (gnu)
  #:use-module (gnu services)
  #:use-module (gnu system setuid)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages dns)
  #:use-module (gnu services admin)
  #:use-module (gnu services dbus)
  #:use-module (gnu services base)
  #:use-module (gnu services shepherd)
  #:use-module (gnu services configuration)

  #:use-module (guix gexp)
  #:use-module (guix records))

(define-record-type* <iwd-configuration>
  iwd-configuration make-iwd-configuration
  iwd-configuration?
  (iwd iwd-configuration-iwd (default iwd))
  (coreutils coreutils-configuration-coreutils (default coreutils))
  (openresolv openresolv-configuration-openresolv (default openresolv))
  (config-file iwd-configuration-config-file
               (default (plain-file "iwd-main.conf"
                                    (string-join
                                     '("[General]"
                                       "EnableNetworkConfiguration=true"
                                       "[Network]"
                                       "NameResolvingService=resolvconf")
                                     "\n" 'suffix)))))

(define (iwd-shepherd-service config)
  (match-record config <iwd-configuration> (iwd openresolv coreutils)
    (let ((environment #~(list (string-append
                                "PATH=" (string-append #$openresolv "/sbin")
                                ":" (string-append #$coreutils "/bin")))))
      (list (shepherd-service
             (documentation "Run Iwd")
             (provision '(iwd networking))
             (requirement '(user-processes dbus-system loopback))
             (start #~(make-forkexec-constructor
                       (list (string-append #$iwd "/libexec/iwd"))
                       #:log-file "/var/log/iwd.log"
                       #:environment-variables #$environment))
             (stop #~(make-kill-destructor)))))))

(define %iwd-log-rotation
  (list (log-rotation (files '("/var/log/iwd.log")))))

(define (iwd-etc-service config)
  (match-record config <iwd-configuration> (config-file)
    `(("iwd/main.conf" ,config-file))))

(define iwd-service-type
  (let ((add-iwd-package (compose list iwd-configuration-iwd)))
    (service-type (name 'iwd)
                  (extensions
                   (list (service-extension shepherd-root-service-type
                                            iwd-shepherd-service)
                         (service-extension dbus-root-service-type
                                            add-iwd-package)
                         (service-extension profile-service-type
                                            add-iwd-package)
                         (service-extension etc-service-type
                                            iwd-etc-service)
                         (service-extension rottlog-service-type
                                            (const %iwd-log-rotation))))
                  (default-value (iwd-configuration))
                  (description
                   "Run @url{https://iwd.wiki.kernel.org/,Iwd},
a network connection manager."))))

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-11 17:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-11 17:10 bug#59971: iwd is packaged but there is no iwd shepherd service Jeremiah
2022-12-23  7:35 ` Hilton Chain via Bug reports for GNU Guix
2022-12-23 12:19   ` Jeremiah
2022-12-23 16:00     ` Nikita Domnitskii via Bug reports for GNU Guix
2022-12-23 22:18       ` Jeremiah
2023-11-11 11:31 ` bug#59971: Jack Faller
2023-11-11 14:27 ` bug#59971: iwd is packaged but there is no iwd shepherd service Jack Faller

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).