From 32904e238fdebfb12c348248a14fc69abeeefa1b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 28 Apr 2024 18:32:43 +0200 Subject: [PATCH] Allow configuring the size of pins --- marker.nix | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/marker.nix b/marker.nix index 3f1964f..c318d32 100644 --- a/marker.nix +++ b/marker.nix @@ -38,6 +38,17 @@ let type = colorType; default = "red"; }; + + size = lib.mkOption { + type = lib.types.enum [ + "tiny" + "small" + "medium" + "large" + ]; + + default = "medium"; + }; }; }; }; @@ -72,6 +83,7 @@ in users = { manuel.departure = { location = "Switzerland"; + style.size = "small"; }; ganondorf.departure = { @@ -105,9 +117,19 @@ in paramForMarker = marker: let + size = { + tiny = "tiny"; + small = "small"; + medium = "mid"; + large = null; + }.${marker.style.size}; attributes = - lib.optional (marker.style.label != null) - "label:${marker.style.label}" + lib.optional + (marker.style.label != null) + "label:${marker.style.label}" + ++ lib.optional + (size != null) + "size:${size}" ++ [ "color:${marker.style.color}" "$(${config.scripts.geocode}/bin/geocode ${