1
0

configuration/gpg-ssh: Enable users to restart pcscd themself

This commit is contained in:
clerie 2024-05-02 11:31:54 +02:00
parent 2970a7d892
commit 5c42594d5d
3 changed files with 23 additions and 0 deletions

View File

@ -7,6 +7,7 @@
./gnome.nix ./gnome.nix
./inputs.nix ./inputs.nix
./networking.nix ./networking.nix
./polkit.nix
./power.nix ./power.nix
./printing.nix ./printing.nix
./ssh.nix ./ssh.nix

View File

@ -0,0 +1,7 @@
{ ... }:
{
security.polkit.enable = true;
}

View File

@ -19,6 +19,21 @@
services.pcscd.enable = true; services.pcscd.enable = true;
# pcscd sometimes breaks and seem to need a manual restart
# so we allow users to restart that service themself
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units"
&& action.lookup("unit") == "pcscd.service"
&& action.lookup("verb") == "restart"
&& subject.isInGroup("users")
) {
return polkit.Result.YES;
}
});
'';
services.udev.packages = with pkgs; [ services.udev.packages = with pkgs; [
yubikey-personalization yubikey-personalization
]; ];