Dynamic variable referring to current environment

Is it possible to refer to a dynamic variable defined in current environment?

Basically I’d like to do the following:

[env]
# I know that current_env doesn't work now, it's an example of referring to the current build environment
src_filter = +<${current_env.board_dir}/board.c>

[env:my_env1]
board_dir = $PROJECT_DIR/boards/my_board1

[env:my_env2]
board_dir = $PROJECT_DIR/boards/my_board2

And then I won’t have to repeat the same line with src_filter in every environment.

This works:

[env]
extra_scripts = pre:add_board_dir.py

[env:my_env1]
board_dir = $PROJECT_DIR/boards/my_board1

[env:my_env2]
board_dir = $PROJECT_DIR/boards/my_board2

Script:

Import("env")

env.Append(SRC_FILTER=["+<" + env.GetProjectOption("board_dir") + "/board.c>"])

Is there any other way?