cosmic: geoclue2 fixes (#415901)

This commit is contained in:
Aleksana
2025-06-15 19:10:29 +08:00
committed by GitHub
2 changed files with 24 additions and 8 deletions
@@ -140,13 +140,21 @@ in
security.rtkit.enable = true;
services.accounts-daemon.enable = true;
services.displayManager.sessionPackages = [ pkgs.cosmic-session ];
services.geoclue2.enable = true;
services.geoclue2.enableDemoAgent = false;
services.libinput.enable = true;
services.upower.enable = true;
# Required for screen locker
security.pam.services.cosmic-greeter = { };
# geoclue2 stuff
services.geoclue2.enable = true;
# We _do_ use the demo agent in the `cosmic-settings-daemon` package,
# but this option also creates a systemd service that conflicts with the
# `cosmic-settings-daemon` package's geoclue2 agent. Therefore, disable it.
services.geoclue2.enableDemoAgent = false;
# As mentioned above, we do use the demo agent. And it needs to be
# whitelisted, otherwise it doesn't run.
services.geoclue2.whitelistedAgents = [ "geoclue-demo-agent" ]; # whitelist our own geoclue2 agent o
# Good to have defaults
hardware.bluetooth.enable = lib.mkDefault true;
networking.networkmanager.enable = lib.mkDefault true;
+14 -6
View File
@@ -8,11 +8,6 @@
let
cfg = config.services.geoclue2;
defaultWhitelist = [
"gnome-shell"
"io.elementary.desktop.agent-geoclue2"
];
appConfigModule = lib.types.submodule (
{ name, ... }:
{
@@ -85,6 +80,16 @@ in
that provides location information for accessing.
'';
};
whitelistedAgents = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
"gnome-shell"
"io.elementary.desktop.agent-geoclue2"
];
description = ''
Desktop IDs (without the .desktop extension) of whitelisted agents.
'';
};
enableDemoAgent = lib.mkOption {
type = lib.types.bool;
@@ -321,7 +326,10 @@ in
{
agent = {
whitelist = lib.concatStringsSep ";" (
lib.optional cfg.enableDemoAgent "geoclue-demo-agent" ++ defaultWhitelist
lib.lists.unique (
cfg.whitelistedAgents
++ lib.optionals config.services.geoclue2.enableDemoAgent [ "geoclue-demo-agent" ]
)
);
};
network-nmea = {