programs: ship geoclue2 as an actual program
moby probably needs its gps.nix file removed. also this is incomplete due to Mozilla terminating their location services API
This commit is contained in:
parent
0db86d8c86
commit
d0d623da15
|
@ -53,6 +53,7 @@
|
||||||
./gdb.nix
|
./gdb.nix
|
||||||
./gdbus.nix
|
./gdbus.nix
|
||||||
./geary.nix
|
./geary.nix
|
||||||
|
./geoclue2
|
||||||
./git.nix
|
./git.nix
|
||||||
./gnome-clocks.nix
|
./gnome-clocks.nix
|
||||||
./gnome-feeds.nix
|
./gnome-feeds.nix
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
./vlc.nix
|
./vlc.nix
|
||||||
./waybar
|
./waybar
|
||||||
./waylock.nix
|
./waylock.nix
|
||||||
|
./where-am-i.nix
|
||||||
./wike.nix
|
./wike.nix
|
||||||
./wine.nix
|
./wine.nix
|
||||||
./wireplumber.nix
|
./wireplumber.nix
|
||||||
|
|
50
hosts/common/programs/geoclue2/default.nix
Normal file
50
hosts/common/programs/geoclue2/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# geoclue location services daemon.
|
||||||
|
#
|
||||||
|
# HOW TO TEST (hopefully):
|
||||||
|
# - build `geoclue2-with-demo-agent`
|
||||||
|
# - run the service: `systemctl start geoclue` or "${geoclue2-with-demo-agent}/libexec/geoclue"
|
||||||
|
# - run "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/agent"
|
||||||
|
# - keep this running in the background
|
||||||
|
# - run "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/where-am-i"
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.geoclue2;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.geoclue2 = {
|
||||||
|
# packageUnwrapped = pkgs.rmDbusServices pkgs.geoclue2;
|
||||||
|
# packageUnwrapped = pkgs.geoclue2.override { withDemoAgent = true; };
|
||||||
|
packageUnwrapped = pkgs.geoclue2-with-demo-agent;
|
||||||
|
suggestedPrograms = [
|
||||||
|
"where-am-i"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
sane.programs.geoclue2.enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
|
||||||
|
|
||||||
|
systemd.packages = lib.mkIf cfg.enableFor.system [ cfg.package ];
|
||||||
|
services.dbus.packages = lib.mkIf cfg.enableFor.system [ cfg.package ];
|
||||||
|
|
||||||
|
# TODO: i should be able to run this as an ordinary user
|
||||||
|
users = lib.mkIf cfg.enableFor.system {
|
||||||
|
users.geoclue = {
|
||||||
|
isSystemUser = true;
|
||||||
|
home = "/var/lib/geoclue";
|
||||||
|
group = "geoclue";
|
||||||
|
description = "Geoinformation service";
|
||||||
|
};
|
||||||
|
|
||||||
|
groups.geoclue = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.geoclue = lib.mkIf cfg.enableFor.system {
|
||||||
|
restartTriggers = [
|
||||||
|
config.environment.etc."geoclue/geoclue.conf".source
|
||||||
|
];
|
||||||
|
serviceConfig.StateDirectory = "geoclue";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc."geoclue/geoclue.conf" = lib.mkIf cfg.enableFor.system {
|
||||||
|
source = ./geoclue.conf;
|
||||||
|
};
|
||||||
|
}
|
43
hosts/common/programs/geoclue2/geoclue.conf
Normal file
43
hosts/common/programs/geoclue2/geoclue.conf
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
[3g]
|
||||||
|
enable=true
|
||||||
|
|
||||||
|
[agent]
|
||||||
|
whitelist=geoclue-demo-agent;gnome-shell;io.elementary.desktop.agent-geoclue2
|
||||||
|
|
||||||
|
[cdma]
|
||||||
|
enable=true
|
||||||
|
|
||||||
|
[epiphany]
|
||||||
|
allowed=true
|
||||||
|
system=false
|
||||||
|
users=
|
||||||
|
|
||||||
|
[firefox]
|
||||||
|
allowed=true
|
||||||
|
system=false
|
||||||
|
users=
|
||||||
|
|
||||||
|
[geoclue-where-am-i]
|
||||||
|
allowed=true
|
||||||
|
system=false
|
||||||
|
users=1000
|
||||||
|
|
||||||
|
[modem-gps]
|
||||||
|
enable=true
|
||||||
|
|
||||||
|
[network-nmea]
|
||||||
|
enable=true
|
||||||
|
|
||||||
|
# i think this one is wrong, and is supposed to be `geoclue-where-am-i`
|
||||||
|
[where-am-i]
|
||||||
|
allowed=true
|
||||||
|
system=false
|
||||||
|
users=1000
|
||||||
|
|
||||||
|
[wifi]
|
||||||
|
enable=true
|
||||||
|
submission-nick=geoclue
|
||||||
|
submission-url=https://location.services.mozilla.com/v1/submit?key=geoclue
|
||||||
|
submit-data=false
|
||||||
|
# url=https://location.services.mozilla.com/v1/geolocate?key=geoclue
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
{
|
{
|
||||||
sane.programs."gnome.gnome-maps" = {
|
sane.programs."gnome.gnome-maps" = {
|
||||||
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-maps;
|
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-maps;
|
||||||
|
suggestedPrograms = [
|
||||||
|
"geoclue2"
|
||||||
|
];
|
||||||
|
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.whitelistDri = true; # for perf
|
sandbox.whitelistDri = true; # for perf
|
||||||
sandbox.whitelistDbus = [
|
sandbox.whitelistDbus = [
|
||||||
|
|
11
hosts/common/programs/where-am-i.nix
Normal file
11
hosts/common/programs/where-am-i.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.where-am-i = {
|
||||||
|
# packageUnwrapped = pkgs.linkIntoOwnPackage config.sane.programs.geoclue2.packageUnwrapped "libexec/geoclue-2.0/demos/where-am-i";
|
||||||
|
packageUnwrapped = pkgs.linkFarm "where-am-i" [{
|
||||||
|
# bring the `where-am-i` tool into a `bin/` directory so it can be invokable via PATH
|
||||||
|
name = "bin/where-am-i";
|
||||||
|
path = "${config.sane.programs.geoclue2.packageUnwrapped}/libexec/geoclue-2.0/demos/where-am-i";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,9 +0,0 @@
|
||||||
{ linkFarm
|
|
||||||
, geoclue2
|
|
||||||
}:
|
|
||||||
linkFarm "where-am-i" [{
|
|
||||||
# bring the `where-am-i` tool into a `bin/` directory so it can be invokable via PATH
|
|
||||||
name = "bin/where-am-i";
|
|
||||||
path = "${geoclue2}/libexec/geoclue-2.0/demos/where-am-i";
|
|
||||||
}]
|
|
||||||
|
|
|
@ -113,7 +113,6 @@ let
|
||||||
runCommandLocalOverridable
|
runCommandLocalOverridable
|
||||||
;
|
;
|
||||||
unftp = callPackage ./additional/unftp { };
|
unftp = callPackage ./additional/unftp { };
|
||||||
where-am-i = callPackage ./additional/where-am-i { };
|
|
||||||
zecwallet-light-cli = callPackage ./additional/zecwallet-light-cli { };
|
zecwallet-light-cli = callPackage ./additional/zecwallet-light-cli { };
|
||||||
|
|
||||||
# packages i haven't used for a while, may or may not still work
|
# packages i haven't used for a while, may or may not still work
|
||||||
|
|
Loading…
Reference in New Issue
Block a user