Based on a Stackoverflow answer, to import environment variables into Verilog you can use:

import "DPI-C" function string getenv(input string env_name);

module top;
  initial begin
    $write("env = %s\n", {getenv("HOME"), "/FileName"});
  end
endmodule