aboutsummaryrefslogtreecommitdiff
path: root/profiles/disableLocation.nix
blob: 1592dbb98701742bdd5cc5f4805377cd6c2838d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, lib, ff, ... }: with lib; {
  options.features.disableLocation = mkOption {
    type = types.bool;
    default = false;
    description = ''
      Forbid requests for the users precise location.
      The remote end will still be able to look up the users IP address in a database, for
      an approximate location.
    '';
  };

  config.policies = mkIf config.features.disableLocation {
    Permissions.Location = {
      BlockNewRequests = true;
      Locked = true;
    };

    Preferences = ff.flattenAttrs {
      geo.enabled = false;
    };
  };
}