From fb4845286b034af498971b3e76257f97fbffc73d Mon Sep 17 00:00:00 2001 From: Bazyli Cyran Date: Sun, 19 Jan 2025 17:14:22 +0100 Subject: [PATCH] feat(nix): Add geoclue settings to the Home Manager module --- nix/hm-module.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 391e7d3..d101c1d 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -35,6 +35,19 @@ in { }; config = { + geoclue = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Enable GeoClue 2 for automatic location detection."; + }; + prefer = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Prefer GeoClue 2 over manual location configuration."; + }; + }; + location = { lat = lib.mkOption { type = with lib.types; nullOr (either float int); @@ -82,7 +95,10 @@ in { home.packages = [cfg.package]; xdg.configFile."timewall/config.toml".source = configFormat.generate "config.toml" ( - lib.optionalAttrs (cfg.config.location.lat != null && cfg.config.location.lon != null) { + { + inherit (cfg.config) geoclue; + } + // lib.optionalAttrs (cfg.config.location.lat != null && cfg.config.location.lon != null) { inherit (cfg.config) location; } // lib.optionalAttrs (cfg.config.setter.command != null) {