How do you configure Nsxiv in NixOS?

I’m trying to change the default background in Nsxiv. To do that, according to this post, I’m supposed to add the supported xresources that are documented in more details in the manpage.

So I tried adding the following to my configuration.nix:

  services = {
    xserver = {
      displayManager.sessionCommands = ''
        ${pkgs.xorg.xrdb}/bin/xrdb -merge <${pkgs.writeText "Xresources" ''
          Nsxiv.*.background = #404552T;
          Nsxiv.*.foreground = #4B5162;

But that didn’t do anything. It didn’t even add anything to my ~/.Xresources file. Any advice on how to configure Nsxiv in NixOS?

Personally I use ~/.Xdefaults with generic settings (meaning *.background: #404552T)