diff --git a/modules/deep-dive/default.nix b/modules/deep-dive/default.nix index 6e57160..378ccf1 100644 --- a/modules/deep-dive/default.nix +++ b/modules/deep-dive/default.nix @@ -1,9 +1,13 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, config, ... }: { options = { scripts.output = lib.mkOption { type = lib.types.package; }; + + requestParams = lib.mkOption { + type = lib.types.listOf lib.types.str; + }; }; config = { @@ -11,8 +15,28 @@ name = "map"; runtimeInputs = with pkgs; [ curl feh ]; text = '' - ${./map.sh} size=640x640 scale=2 | feh - + ${./map.sh} ${lib.concatStringsSep " " + config.requestParams} | feh - ''; }; + + requestParams = [ + "size=640x640" + "scale=2" + (lib.mkIf (config.map.zoom != null) + "zoom=${toString config.map.zoom}") + ]; + + map = { + zoom = lib.mkOption { + type = lib.types.nullOr lib.types.int; + default = 10; + }; + + center = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = "switzerland"; + }; + }; }; } \ No newline at end of file