From 453c004e899cdf468633580f6ea9255622c1dfd5 Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Fri, 26 Apr 2024 07:40:24 +0200
Subject: [PATCH] Allow setting the zoom level of the map

---
 default.nix | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/default.nix b/default.nix
index c395567..e6bc0e2 100644
--- a/default.nix
+++ b/default.nix
@@ -5,6 +5,13 @@
       type = lib.types.package;
     };
 
+    map = {
+      zoom = lib.mkOption {
+        type = lib.types.nullOr lib.types.int;
+        default = 2;
+      };
+    };
+
     requestParams = lib.mkOption {
       type = lib.types.listOf lib.types.str;
     };
@@ -13,6 +20,7 @@
   config = {
     scripts.output = pkgs.writeShellApplication {
       name = "map";
+
       runtimeInputs = with pkgs; [
         curl
         imagemagick
@@ -26,6 +34,8 @@
     requestParams = [
       "size=640x300"
       "scale=2"
+      (lib.mkIf (config.map.zoom != null)
+        "zoom=${toString config.map.zoom}")
     ];
   };
 }