geoclue2: add static option
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
5b5a6d823b
commit
71d72af36c
2 changed files with 21 additions and 16 deletions
|
@ -8,6 +8,7 @@ with lib; {
|
||||||
(mkIf config.custom.default {
|
(mkIf config.custom.default {
|
||||||
#// automatic-timezoned.enable = true;
|
#// automatic-timezoned.enable = true;
|
||||||
#// agenix.enable = true;
|
#// agenix.enable = true;
|
||||||
|
geoclue2.enable = true;
|
||||||
#// netbird.enable = true;
|
#// netbird.enable = true;
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
tzupdate.enable = true;
|
tzupdate.enable = true;
|
||||||
|
@ -17,7 +18,6 @@ with lib; {
|
||||||
dbus.enable = true;
|
dbus.enable = true;
|
||||||
flatpak.enable = true;
|
flatpak.enable = true;
|
||||||
fwupd.enable = true;
|
fwupd.enable = true;
|
||||||
geoclue2.enable = true;
|
|
||||||
#// kdeconnect.enable = true;
|
#// kdeconnect.enable = true;
|
||||||
libinput.enable = true;
|
libinput.enable = true;
|
||||||
logind.enable = true;
|
logind.enable = true;
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.custom.services.geoclue2;
|
cfg = config.custom.services.geoclue2;
|
||||||
in {
|
in {
|
||||||
options.custom.services.geoclue2.enable = mkOption {default = false;};
|
options.custom.services.geoclue2 = {
|
||||||
|
enable = mkOption {default = false;};
|
||||||
|
static = mkOption {default = true;};
|
||||||
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
age.secrets = let
|
age.secrets = let
|
||||||
|
@ -17,28 +20,30 @@ in {
|
||||||
group = "geoclue";
|
group = "geoclue";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
"common/geoclue2/geolocation" = secret "common/geoclue2/geolocation";
|
"common/geoclue2/geolocation" = mkIf cfg.static (secret "common/geoclue2/geolocation");
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://gitlab.freedesktop.org/geoclue/geoclue
|
# https://gitlab.freedesktop.org/geoclue/geoclue
|
||||||
# FIXME: geoclue2 relies on MLS, which is retired
|
# FIXME: geoclue2 relies on MLS, which is retired
|
||||||
# https://github.com/NixOS/nixpkgs/issues/321121
|
# https://github.com/NixOS/nixpkgs/issues/321121
|
||||||
# TODO: Use static source option when merged into unstable
|
services.geoclue2 =
|
||||||
# https://github.com/NixOS/nixpkgs/pull/329654
|
{
|
||||||
services.geoclue2 = {
|
enable = true;
|
||||||
enable = true;
|
}
|
||||||
|
// optionalAttrs cfg.static {
|
||||||
# Overriden by static source
|
# TODO: Use static source option when merged into unstable
|
||||||
enable3G = false;
|
# https://github.com/NixOS/nixpkgs/pull/329654
|
||||||
enableCDMA = false;
|
# Overriden by static source
|
||||||
enableModemGPS = false;
|
enable3G = false;
|
||||||
enableNmea = false;
|
enableCDMA = false;
|
||||||
enableWifi = false;
|
enableModemGPS = false;
|
||||||
};
|
enableNmea = false;
|
||||||
|
enableWifi = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Manually use static source from coordinates
|
# Manually use static source from coordinates
|
||||||
# https://github.com/NixOS/nixpkgs/issues/311595#issuecomment-2247989491
|
# https://github.com/NixOS/nixpkgs/issues/311595#issuecomment-2247989491
|
||||||
environment.etc = {
|
environment.etc = mkIf cfg.static {
|
||||||
"geolocation".source = config.age.secrets."common/geoclue2/geolocation".path;
|
"geolocation".source = config.age.secrets."common/geoclue2/geolocation".path;
|
||||||
|
|
||||||
"geoclue/conf.d/00-config.conf".text = ''
|
"geoclue/conf.d/00-config.conf".text = ''
|
||||||
|
|
Loading…
Reference in a new issue