From: Martin Castillo <castilma@uni-bremen.de>
To: SeerLite <seerlite@disroot.org>, help-guix@gnu.org
Subject: Re: getting loginctl to work
Date: Mon, 27 Mar 2023 15:18:58 +0200 [thread overview]
Message-ID: <d58a2d53-5023-f250-78ab-f33b7280e206@uni-bremen.de> (raw)
In-Reply-To: <A6C249D0-8C78-49A0-A3A3-390AD57B26B8@disroot.org>
Hi,
Am 27.03.23 um 12:21 schrieb SeerLite:
> Hi! Is it maybe Polkit? Polkit was stopping me from suspending my laptop via SSH. The exact same behavior as you: no output and error code 1.
>
> Since the only `loginctl` command I cared about was `suspend`, I added my user to the `power` group, added the `power` group to `operating-system`, defined the following extension:
>
> ; Rule template stolen from from gnu/services/desktop.scm: polkit-wheel
> ; and rule itself stolen from https://askubuntu.com/a/992878
> (define polkit-power-rules
> (file-union
> "polkit-power"
> `(("share/polkit-1/rules.d/power.rules"
> ,(plain-file
> "power.rules"
> "polkit.addRule(function(action, subject) {
> if (action.id == \"org.freedesktop.login1.suspend\" &&
> subject.isInGroup(\"power\")) {
> return polkit.Result.YES;
> }
> });")))))
>
>
> and added the above to my services like:
>
> (simple-service 'polkit-power-rules polkit-service-type (list polkit-power-rules))
>
> You'd have to do something but I'm guessing for `login1.poweroff` instead.
Thank you, that works. I think this kind of rule should be expected on
most systems. It would be nice if this kind of polkit rule was
predefined as a variable in guix, or the manual (or at least the
cookbook) should give this as an example.
prev parent reply other threads:[~2023-03-27 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 21:20 getting loginctl to work Martin Castillo
2023-03-23 19:09 ` Csepp
2023-03-24 16:04 ` Martin Castillo
2023-03-27 10:21 ` SeerLite
2023-03-27 13:18 ` Martin Castillo [this message]
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=d58a2d53-5023-f250-78ab-f33b7280e206@uni-bremen.de \
--to=castilma@uni-bremen.de \
--cc=help-guix@gnu.org \
--cc=seerlite@disroot.org \
/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.