PostgreSQL custom domain with trigger
You cannot do that.

As the documentation says:


  CREATE TRIGGER creates a new trigger. The trigger will be associated
  with the specified table or view


This clearly excludes types and domains.  (Very logically: triggers are normally fired upon changing something - here you want to change a column, not the type.)

You should instead use a stored procedure to take care of your password column(s).  And personally I think the less places password are stored at, the better.