summaryrefslogtreecommitdiff
path: root/nixos/modules/location.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/location.nix')
-rw-r--r--nixos/modules/location.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/modules/location.nix b/nixos/modules/location.nix
new file mode 100644
index 0000000..a99aaa7
--- /dev/null
+++ b/nixos/modules/location.nix
@@ -0,0 +1,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};
+ };
+}