{ pkgs, lib, config, ... }: { options = { scripts.output = lib.mkOption { 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; }; }; config = { scripts.output = pkgs.writeShellApplication { name = "map"; runtimeInputs = with pkgs; [ curl imagemagick ]; text = '' convert <(${./map} ${lib.concatStringsSep " " config.requestParams}) sixel:- ''; }; requestParams = [ "size=640x300" "scale=2" (lib.mkIf (config.map.zoom != null) "zoom=${toString config.map.zoom}") ]; }; }