Do you have a special reason to use that module attribute? Some name it an anti-pattern, discussion on using (secret) config info in this way and alternatives you can find here:
When you do not use the module attribute (see links above) you can write:
defmodule Foo do
def check(secret), do: if Application.get_env(:foo, :secret) in [secret, nil], do: :ok, else: :error
end
otherwise
defmodule Foo do
@secret Application.get_env(:foo, :secret)
def check(secret), do: if @secret in [secret, nil], do: :ok, else: :error
end