summaryrefslogtreecommitdiff
path: root/nixos/modules/location.nix
blob: a99aaa77d6bd4d20e75687cf4de8a036dcf21934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ config, lib, pkgs, ... }:
with lib;

let
  cfg = config.eth;

  locations = {
    London = {
      latitude = 51.5074;
      longitude = 0.1278;
    };
  };

in {
  options.eth.location = mkOption {
    type = types.nullOr (types.enum (builtins.attrNames locations));
    default = null;
    description = "City name.";
  };

  config = mkIf (cfg.location != null) {
    location = locations.${cfg.location};
  };
}