Allow setting the zoom level of the map

This commit is contained in:
Manuel Thalmann 2024-04-26 07:40:24 +02:00
parent 2707d84a50
commit 453c004e89

View file

@ -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}")
];
};
}