Skip to content

Commit 64479c9

Browse files
author
BeatLink
committed
feat(thor): install Pure Maps with an offline map server
Qt Quick is the toolkit whose scene graph targets GLES 2.0, so this is the one map application the Mali-400 accelerates rather than rasterises: it draws through mapbox-gl-qml. OSM Scout Server holds the tiles, the geocoder and the router behind it, and espeak is what speaks the directions. QtPositioning's geoclue2 plugin asks for a client under the application name, so `pure-maps` joins the allow-list geoclue matches ids against. nixpkgs installs no D-Bus activation file for the server, so one is declared here; without it Pure Maps cannot start the server and offline mode works only while the server's own window is open. The map directory is chosen on the server's first run. Its own default, ~/Maps.OSM, is persisted for it, since map downloads are gigabytes.
1 parent 41811ac commit 64479c9

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

‎nix/5-phone/1-system/dconf/shell/org.gnome.desktop.app-folders.dconf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apps=['waypipe-discord-heimdall.desktop', 'waypipe-element-heimdall.desktop', 'w
66
name='Desktop'
77

88
[folders/c3f8a6b1-7d24-4e59-a0c7-5b1e9f2d8a63]
9-
apps=['htop.desktop', 'io.github.beatlink.Chargectl.desktop', 'me.gapixels.Megapixels.desktop', 'mobi.phosh.MobileSettings.desktop', 'org.gnome.Calls.desktop', 'org.gnome.ColorProfileViewer.desktop', 'org.gnome.Extensions.desktop', 'org.gnome.Settings.desktop', 'org.gnome.Terminal.desktop', 'rygel-preferences.desktop', 'sm.puri.Chatty.desktop']
9+
apps=['htop.desktop', 'io.github.beatlink.Chargectl.desktop', 'io.github.rinigus.PureMaps.desktop', 'me.gapixels.Megapixels.desktop', 'mobi.phosh.MobileSettings.desktop', 'org.gnome.Calls.desktop', 'org.gnome.ColorProfileViewer.desktop', 'org.gnome.Extensions.desktop', 'org.gnome.Settings.desktop', 'org.gnome.Terminal.desktop', 'osmscout-server-gui.desktop', 'rygel-preferences.desktop', 'sm.puri.Chatty.desktop']
1010
name='Native'
1111

1212
[folders/b7e2d4a9-8c61-4f30-95ab-2d7c6e0f3b18]

‎nix/5-phone/3-apps/native/default.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{
66
imports = [
77
./camera.nix
8+
./maps.nix
89
./phone.nix
910
./sms.nix
1011
];

‎nix/5-phone/3-apps/native/maps.nix‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Maps ###############################################################################################################################################
2+
#
3+
# Pure Maps and the offline server behind it, both on the phone itself: Qt Quick is the one toolkit this Mali-400 accelerates, and navigation is
4+
# wanted exactly where the link is not.
5+
#
6+
{ lib, pkgs, ... }:
7+
{
8+
# QtPositioning's geoclue2 plugin asks for a client under the application name, and geoclue hands no fix at all to an id its config does not list
9+
services.geoclue2.appConfig.pure-maps = {
10+
isAllowed = true;
11+
isSystem = false;
12+
};
13+
14+
home-manager.users.beatlink = {
15+
home = {
16+
packages = with pkgs; [
17+
pure-maps
18+
osmscout-server
19+
espeak-ng # Pure Maps speaks its directions through whichever of espeak, flite, mimic or pico2wave it finds on PATH
20+
];
21+
22+
# Map downloads are gigabytes; this is the directory the server offers on first run, kept out of the rollback rather than in it
23+
persistence."/Storage/Apps/System/Maps" = {
24+
directories = [
25+
"Maps.OSM"
26+
".config/osmscout-server"
27+
".config/pure-maps"
28+
".local/share/pure-maps"
29+
];
30+
};
31+
};
32+
33+
# Upstream ships this and nixpkgs drops it; without it Pure Maps cannot start the server, and offline mode works only while its window is open
34+
xdg.dataFile."dbus-1/services/io.github.rinigus.OSMScoutServer.service".text = ''
35+
[D-BUS Service]
36+
Name=io.github.rinigus.OSMScoutServer
37+
Exec=${lib.getExe' pkgs.osmscout-server "osmscout-server"} --dbus-activated --quiet
38+
'';
39+
};
40+
}

0 commit comments

Comments
 (0)