forked from mirrors/nixpkgs
geoclue2 service: add option to run demo agent
This commit is contained in:
parent
284fc9b449
commit
316669327c
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
# the demo agent isn't built by default, but we need it here
|
||||||
|
package = pkgs.geoclue2.override { withDemoAgent = config.services.geoclue2.enableDemoAgent; };
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
@ -21,21 +25,42 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableDemoAgent = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to use the GeoClue demo agent. This should be
|
||||||
|
overridden by desktop environments that provide their own
|
||||||
|
agent.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf config.services.geoclue2.enable {
|
config = mkIf config.services.geoclue2.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.geoclue2 ];
|
environment.systemPackages = [ package ];
|
||||||
|
|
||||||
services.dbus.packages = [ pkgs.geoclue2 ];
|
services.dbus.packages = [ package ];
|
||||||
|
|
||||||
systemd.packages = [ pkgs.geoclue2 ];
|
systemd.packages = [ package ];
|
||||||
|
|
||||||
|
# this needs to run as a user service, since it's associated with the
|
||||||
|
# user who is making the requests
|
||||||
|
systemd.user.services = mkIf config.services.geoclue2.enableDemoAgent {
|
||||||
|
"geoclue-agent" = {
|
||||||
|
description = "Geoclue agent";
|
||||||
|
script = "${package}/libexec/geoclue-2.0/demos/agent";
|
||||||
|
# this should really be `partOf = [ "geoclue.service" ]`, but
|
||||||
|
# we can't be part of a system service, and the agent should
|
||||||
|
# be okay with the main service coming and going
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,8 @@ in {
|
||||||
services.udisks2.enable = true;
|
services.udisks2.enable = true;
|
||||||
services.accounts-daemon.enable = true;
|
services.accounts-daemon.enable = true;
|
||||||
services.geoclue2.enable = mkDefault true;
|
services.geoclue2.enable = mkDefault true;
|
||||||
|
# GNOME should have its own geoclue agent
|
||||||
|
services.geoclue2.enableDemoAgent = false;
|
||||||
services.dleyna-renderer.enable = mkDefault true;
|
services.dleyna-renderer.enable = mkDefault true;
|
||||||
services.dleyna-server.enable = mkDefault true;
|
services.dleyna-server.enable = mkDefault true;
|
||||||
services.gnome3.at-spi2-core.enable = true;
|
services.gnome3.at-spi2-core.enable = true;
|
||||||
|
|
Loading…
Reference in a new issue