all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Wheel group as polkit admins
@ 2019-11-09 14:40 Leo Prikler
  2019-11-17 16:46 ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Prikler @ 2019-11-09 14:40 UTC (permalink / raw)
  To: guix-devel

Hello,

some other distros use a Polkit rule, that makes the local admin group
("wheel" on Guix) Polkit admins.  Yet others easily allow writing your
own files to /etc, so that such a rule can be added.  Guix lacks such a
rule by default and adding it in the way you're supposed to in other
distros is not very guixy.

Since our polkit service expects a list of packages as extension, I
currently use the following in my /etc/config.scm:

--8<---------------cut here---------------start------------->8---
(define polkit-wheel
  (package
   (name "polkit-wheel")
   (version "0")
   (source #f)
   (build-system trivial-build-system)
   (arguments
    `(#:modules ((guix build utils))
      #:builder
      (begin
        (use-modules ((guix build utils)))
        (let ((rules.d (string-append %output "/share/polkit-
1/rules.d")))
          (mkdir-p rules.d)
          (with-output-to-file (string-append rules.d "/wheel.rules")
            (lambda ()
              (display "polkit.addAdminRule(function(action, subject) {
    return [\"unix-group:wheel\"];
});
")))))))
   (home-page #f)
   (synopsis "Make wheel adminstrate")
   (description #f)
   (license #f)))

(define polkit-wheel-service-type
  (service-type (name 'polkit-wheel)
                (extensions
                 (list (service-extension polkit-service-type
                                          (const (list polkit-
wheel)))))
                (default-value '())))
--8<---------------cut here---------------end--------------->8---

The problems with this apporach should be clear.  "polkit-wheel" is by
no stretch of the imagination an actual package.  It is so trivial,
that it might as well just be a file.  Is there a simpler way of
extending polkit, perhaps with just a g-expression?

Regards,

Leo

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

end of thread, other threads:[~2019-11-30 22:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-09 14:40 Wheel group as polkit admins Leo Prikler
2019-11-17 16:46 ` Ludovic Courtès
2019-11-17 17:52   ` Leo Prikler
2019-11-23 17:17     ` Ludovic Courtès
2019-11-23 19:08       ` Leo Prikler
2019-11-26 10:17         ` Ludovic Courtès
2019-11-26 12:35           ` Leo Prikler
2019-11-30 22:51             ` Ludovic Courtès
2019-11-17 18:18   ` Marius Bakke

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.