all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Leo Prikler <leo.prikler@student.tugraz.at>
Cc: guix-devel@gnu.org
Subject: Re: Wheel group as polkit admins
Date: Sun, 17 Nov 2019 17:46:18 +0100	[thread overview]
Message-ID: <87mucuo3hh.fsf@gnu.org> (raw)
In-Reply-To: <17ea661e09a034c36151b72ca1ab508a3fc52d1c.camel@student.tugraz.at> (Leo Prikler's message of "Sat, 09 Nov 2019 15:40:41 +0100")

Hi Leo,

Leo Prikler <leo.prikler@student.tugraz.at> skribis:

> Since our polkit service expects a list of packages as extension, I
> currently use the following in my /etc/config.scm:
>
> (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 '())))
>
> 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?

Yup, I think you could make it a ‘computed-file’ instead of a package:

  (computed-file "polkit-wheel-rule"
                 (with-imported-modules '((guix build utils))
                   #~(begin …)))

Should we make that the default, BTW?  It would seem to make sense as
that’s the whole point of the “wheel” group.

What do people think?

Thanks,
Ludo’.

  reply	other threads:[~2019-11-17 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09 14:40 Wheel group as polkit admins Leo Prikler
2019-11-17 16:46 ` Ludovic Courtès [this message]
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

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=87mucuo3hh.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=leo.prikler@student.tugraz.at \
    /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.