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; type = lib.types.package;
}; };
map = {
zoom = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = 2;
};
};
requestParams = lib.mkOption { requestParams = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
}; };
@ -13,6 +20,7 @@
config = { config = {
scripts.output = pkgs.writeShellApplication { scripts.output = pkgs.writeShellApplication {
name = "map"; name = "map";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
curl curl
imagemagick imagemagick
@ -26,6 +34,8 @@
requestParams = [ requestParams = [
"size=640x300" "size=640x300"
"scale=2" "scale=2"
(lib.mkIf (config.map.zoom != null)
"zoom=${toString config.map.zoom}")
]; ];
}; };
} }