From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Wheel group as polkit admins Date: Sun, 17 Nov 2019 17:46:18 +0100 Message-ID: <87mucuo3hh.fsf@gnu.org> References: <17ea661e09a034c36151b72ca1ab508a3fc52d1c.camel@student.tugraz.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35815) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWNgs-0007IC-RK for guix-devel@gnu.org; Sun, 17 Nov 2019 11:46:23 -0500 In-Reply-To: <17ea661e09a034c36151b72ca1ab508a3fc52d1c.camel@student.tugraz.at> (Leo Prikler's message of "Sat, 09 Nov 2019 15:40:41 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Prikler Cc: guix-devel@gnu.org Hi Leo, Leo Prikler 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 =E2=80=98computed-file=E2=80=99 instead of= a package: (computed-file "polkit-wheel-rule" (with-imported-modules '((guix build utils)) #~(begin =E2=80=A6))) Should we make that the default, BTW? It would seem to make sense as that=E2=80=99s the whole point of the =E2=80=9Cwheel=E2=80=9D group. What do people think? Thanks, Ludo=E2=80=99.