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 {
|
||||
#// automatic-timezoned.enable = true;
|
||||
#// agenix.enable = true;
|
||||
geoclue2.enable = true;
|
||||
#// netbird.enable = true;
|
||||
tailscale.enable = true;
|
||||
tzupdate.enable = true;
|
||||
|
@ -17,7 +18,6 @@ with lib; {
|
|||
dbus.enable = true;
|
||||
flatpak.enable = true;
|
||||
fwupd.enable = true;
|
||||
geoclue2.enable = true;
|
||||
#// kdeconnect.enable = true;
|
||||
libinput.enable = true;
|
||||
logind.enable = true;
|
||||
|
|
|
@ -7,7 +7,10 @@
|
|||
with lib; let
|
||||
cfg = config.custom.services.geoclue2;
|
||||
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 {
|
||||
age.secrets = let
|
||||
|
@ -17,28 +20,30 @@ in {
|
|||
group = "geoclue";
|
||||
};
|
||||
in {
|
||||
"common/geoclue2/geolocation" = secret "common/geoclue2/geolocation";
|
||||
"common/geoclue2/geolocation" = mkIf cfg.static (secret "common/geoclue2/geolocation");
|
||||
};
|
||||
|
||||
# https://gitlab.freedesktop.org/geoclue/geoclue
|
||||
# FIXME: geoclue2 relies on MLS, which is retired
|
||||
# https://github.com/NixOS/nixpkgs/issues/321121
|
||||
# TODO: Use static source option when merged into unstable
|
||||
# https://github.com/NixOS/nixpkgs/pull/329654
|
||||
services.geoclue2 = {
|
||||
enable = true;
|
||||
|
||||
# Overriden by static source
|
||||
enable3G = false;
|
||||
enableCDMA = false;
|
||||
enableModemGPS = false;
|
||||
enableNmea = false;
|
||||
enableWifi = false;
|
||||
};
|
||||
services.geoclue2 =
|
||||
{
|
||||
enable = true;
|
||||
}
|
||||
// optionalAttrs cfg.static {
|
||||
# TODO: Use static source option when merged into unstable
|
||||
# https://github.com/NixOS/nixpkgs/pull/329654
|
||||
# Overriden by static source
|
||||
enable3G = false;
|
||||
enableCDMA = false;
|
||||
enableModemGPS = false;
|
||||
enableNmea = false;
|
||||
enableWifi = false;
|
||||
};
|
||||
|
||||
# Manually use static source from coordinates
|
||||
# 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;
|
||||
|
||||
"geoclue/conf.d/00-config.conf".text = ''
|
||||
|
|
Loading…
Reference in a new issue