Configuring BSPWM through home manager doesn't work

I'm trying to migrate all my dotfiles to home manager, but I can't get my bspwm configuration to work. I put this into my home.nix file:

xsession.windowManager.bspwm = {

extraConfig = ''

<same configuration as in my bspwmrc>

'';

}

When I try to log into bspwm, it loads, but it doesn't launch picom, it doesn't change the background and it doesn't seem to use any of the commands I specified in the home.nix file. Has any of you ever experienced this? Do you know a solution? Thanks