Skip to content

Commit

Permalink
feat(nix): Add geoclue settings to the Home Manager module
Browse files Browse the repository at this point in the history
  • Loading branch information
bcyran committed Jan 19, 2025
1 parent 26ad6fd commit fb48452
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fb48452

Please sign in to comment.