2022-11-21 17:40:18 +00:00
|
|
|
{ pkgs, config, lib, ...}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.mepo;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.mepo = {
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = mkEnableOption "Mepo, a fast, simple and hackable OSM map viewer";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
locationBackends = {
|
|
|
|
gpsd = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2022-11-21 17:40:18 +00:00
|
|
|
Whether to enable location detection via gpsd.
|
|
|
|
This may require additional configuration of gpsd, see [here](#opt-services.gpsd.enable)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
geoclue = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Whether to enable location detection via geoclue";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
mepo
|
|
|
|
] ++ lib.optional cfg.locationBackends.geoclue geoclue2-with-demo-agent
|
|
|
|
++ lib.optional cfg.locationBackends.gpsd gpsd;
|
|
|
|
|
|
|
|
services.geoclue2 = mkIf cfg.locationBackends.geoclue {
|
|
|
|
enable = true;
|
|
|
|
appConfig.where-am-i = {
|
|
|
|
isAllowed = true;
|
|
|
|
isSystem = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.gpsd.enable = cfg.locationBackends.gpsd;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta.maintainers = with maintainers; [ laalsaas ];
|
|
|
|
}
|