The options API has been updated, in order for a more flexible setup with `local.modules.desktop.enable` being replaced with an enum of desktops at `local.systemVars.desktop`, which allows for switching desktop environments by changing a single option. This is so that we can switch to cosmic and only enable the programs we need (i.e. disable greetd because we use cosmic-greeter and enable terminals since that is desktop related). This is simpler than having a different module per desktop.
43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}: {
|
|
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
|
security = {
|
|
polkit.enable = true;
|
|
polkit = {
|
|
extraConfig = ''
|
|
polkit.addRule(function(action, subject) {
|
|
if (
|
|
subject.isInGroup("users")
|
|
&& (
|
|
action.id == "org.freedesktop.login1.reboot" ||
|
|
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
|
|
action.id == "org.freedesktop.login1.power-off" ||
|
|
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
|
|
)
|
|
)
|
|
{
|
|
return polkit.Result.YES;
|
|
}
|
|
});
|
|
'';
|
|
};
|
|
};
|
|
systemd.user.services.polkit-gnome-authentication-agent-1 = {
|
|
description = "polkit-gnome-authentication-agent-1";
|
|
wantedBy = ["graphical-session.target"];
|
|
wants = ["graphical-session.target"];
|
|
after = ["graphical-session.target"];
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
|
Restart = "on-failure";
|
|
RestartSec = 1;
|
|
TimeoutStopSec = 10;
|
|
};
|
|
};
|
|
};
|
|
}
|