From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Prikler Subject: Wheel group as polkit admins Date: Sat, 09 Nov 2019 15:40:41 +0100 Message-ID: <17ea661e09a034c36151b72ca1ab508a3fc52d1c.camel@student.tugraz.at> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42575) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTRv2-00023e-MW for guix-devel@gnu.org; Sat, 09 Nov 2019 09:40:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTRv1-0005Qr-7c for guix-devel@gnu.org; Sat, 09 Nov 2019 09:40:52 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:15578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iTRv0-0005PB-Nj for guix-devel@gnu.org; Sat, 09 Nov 2019 09:40:51 -0500 Received: from nijino.local (194-96-102-81.hdsl.highway.telekom.at [194.96.102.81]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 479KZ52FWQz1LLyX for ; Sat, 9 Nov 2019 15:40:44 +0100 (CET) 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: guix-devel@gnu.org 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