diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/location.nix | 24 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 |
2 files changed, 25 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}; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index b0d788c..92b2cf6 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -2,6 +2,7 @@ ./hardware/keyboard.nix ./hardware/linode.nix ./hardware/yubikey.nix + ./location.nix ./nix.nix ./programs/dwm.nix ./services/ambience.nix |