Thinking about what to do when you have the nuts or near-nuts is a nice way to think through basic poker concepts. You can safely assume that all you want is for the most money possible to go into the pot.
Here there are two main questions to consider.
How strong is my opponent's range?
Here we need to know something about the preflop action. How much strength did your opponent show, and which sorts of hands does your opponent play in such a way? Note that many boards on which straight flushes are possible are boards for which the strong preflop hands are not the strongest hands on the flop. Note also that flopping a straight flush on a AKT board is not the same as flopping a straight flush on a 765 board: in the former case, you will tend to be happiest if your opponent showed a lot of strength before the flop, because he is likelier to have the sorts of hands that will pay you off.
After you go through this reasoning, you should usually be more inclined to play aggressively if your opponent figures to often have a hand that can stand aggression. Note, however, that aggressive play will often be correct even if your opponent does not figure to have too much: especially when he figures to want to get to showdown cheaply, which will often be the case on monotone boards, you have to put the money in yourself if you want the money to go in the pot at all.
How can I keep my range the widest?
In other words: how can I represent weaker hands? Here again we need to know more about the preflop action. Often betting is more deceptive than not betting, and slowplaying your hand will often make your opponent think that you cannot have the hands that you want him to think you have.
If you want a quick and dirty rule: it will usually be best to go ahead and play aggressively, hoping that your opponent has something to pay you off with. Here as always, however, there is no substitute for thinking through the hand and what each player has represented with the action up to the decision.