Polkit: Difference between revisions

Dass (talk | contribs)
m Fix minor typing and consistency errors
Rrdpad (talk | contribs)
Update syntax for example systemd unit
 
(One intermediate revision by one other user not shown)
Line 61: Line 61:
Alternatively, you can start it on login by creating a systemd user service:
Alternatively, you can start it on login by creating a systemd user service:


=== Using NixOS ===
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
systemd = {
systemd.user.services.polkit-gnome-authentication-agent-1 = {
  user.services.polkit-gnome-authentication-agent-1 = {
  description = "polkit-gnome-authentication-agent-1";
    description = "polkit-gnome-authentication-agent-1";
  wantedBy = [ "graphical-session.target" ];
    wantedBy = [ "graphical-session.target" ];
  wants = [ "graphical-session.target" ];
    wants = [ "graphical-session.target" ];
  after = [ "graphical-session.target" ];
    after = [ "graphical-session.target" ];
  serviceConfig = {
    serviceConfig = {
    Type = "simple";
        Type = "simple";
    ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
        ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
    Restart = "on-failure";
        Restart = "on-failure";
    RestartSec = 1;
        RestartSec = 1;
    TimeoutStopSec = 10;
        TimeoutStopSec = 10;
      };
   };
   };
};
};
</syntaxhighlight>
</syntaxhighlight>


Another option is <code>lxqt.lxqt-policykit</code>, which can be launched on login through the command <code>lxqt-policykit-agent</code> on e.g. Hyprland.
=== Using Home Manager ===
<syntaxhighlight lang="nix">
systemd.user.services.polkit-gnome-authentication-agent-1 = {
  Unit = {
    Description = "polkit-gnome-authentication-agent-1";
    Wants = [ "graphical-session.target" ];
    After = [ "graphical-session.target" ];
  };
  Install = {
    WantedBy = [ "graphical-session.target" ];
  };
  Service = {
    Type = "simple";
    ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
    Restart = "on-failure";
    RestartSec = 1;
    TimeoutStopSec = 10;
  };
};
</syntaxhighlight>Another option is <code>lxqt.lxqt-policykit</code>, which can be launched on login through the command <code>lxqt-policykit-agent</code> on e.g. Hyprland.


== Start the authentication agent in dwm ==
== Start the authentication agent in dwm ==