[SOLVED] How do I declare text bound after lib.mkBefore text

In a function I have

bashrcExtra = ''
  # some code that goes injected after the lines
  # "# Commands that should be applied only for interactive shells.
  # if [[ $- == *i* ]]; then"
  # in ~/.bashrc when calling the function
'';

but I also want besides the above

bashrcExtra = lib.mkBefore ''
  # code that is prepended to the above lines
''

As a reference for now I just have this.

Is there a way to have the bashrcExtra behave like this, text but bound to also lib.mkBefore text ?

To answer (found here) myself this question, use lib.mkMerge:

programs.bash.bashrcExtra = lib.mkMerge [
        (lib.mkBefore ''
          # goes top
        '')
        (lib.mkAfter ''
          # goes bottom
        '')
];